<commit_before>##Blue Slopes

In this Blue Slope run we will extend what we learned with the Exhibit version 2 work on the Green Slope and see how we can work with RSS feeds to give faceted browsing based on text matches and to give timelines.

For background on RSS data feeds check out the [Wikipedia article](http://en.wikipedia.org/wiki/RSS).  These are XML feeds.  There is a [Google API service](https://www.google.com/jsapi) that converts these XML feeds to JSON, and then to get we need to do a little modification of this JSON structure to make it work correctly with Exhibit.  The googlefeeds-importer.js (from the [Ensemble Project](http://www.ensemble.ac.uk/)) does this modification.

Many organisations produce RSS data feeds, so pick one and look at it in your web browser.  Your browser will probably create a simple visualisation of the data, so view the source code in the usual way (right-click etc) to take a peek at the underlying XML.

##Down to business!

In your favourite text editor create the following skelton file and save it ...BlueSlopeExample1.html.

```html
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <title>My Blue Slope Example 1</title>
            <!--Exhibit JS and other libraries-->
            <script type="text/javascript" src="http://api.simile-widgets.org/exhibit/2.2.0/exhibit-api.js"></script>
            <script type="text/javascript" src="http://api.simile-widgets.org/exhibit/2.2.0/extensions/time/time-extension.js" ></script>
            <script type="text/javascript" src="https://www.google.com/jsapi"></script>
            <script type="text/javascript" src="googlefeeds-importer.js"></script>
            <!--data-->
            <!--styles-->
             <link rel='stylesheet' href='http://www.simile-widgets.org/styles/common.css' type='text/css' />            
        </head>
        <body>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p>
            
            <!--lenses-->
            
            <!--display options-->
            
            <!--facets-->
            
            <!--list view-->
            
            <!--Search-->            
            
            <!--cloud view-->
            
            <!--Debug textarea-->
        </body>
    </html>
```
Download and save the `googlefeeds-importer.js` and `__history__.html` files in the same folder.

Open up your `BlueSlopeExample1.html` file in a web browser and confirm that  it loads without any errors.

Back to the editor now, and add two RSS feeds as Exhibit data sources just below the placemarker

```html
     <link 
     href="http://scottishgovernment.presscentre.com/rss/default.aspx?feedid={8d8b9894-a7c9-4afd-91f2-bcc7e2ea81f6}" 
     type="application/rss+xml" rel="exhibit/data" /> 
     <link 
     href="http://www.trafficscotland.org/rss/feeds/currentincidents.aspx" 
     type="application/rss+xml" rel="exhibit/data" /> 
```<commit_msg>Update BlueSlopes.md<commit_after>##Blue Slopes

In this Blue Slope run we will extend what we learned with the Exhibit version 2 work on the Green Slope and see how we can work with RSS feeds to give faceted browsing based on text matches and to give timelines.

For background on RSS data feeds check out the [Wikipedia article](http://en.wikipedia.org/wiki/RSS).  These are XML feeds.  There is a [Google API service](https://www.google.com/jsapi) that converts these XML feeds to JSON, and then to get we need to do a little modification of this JSON structure to make it work correctly with Exhibit.  The googlefeeds-importer.js (from the [Ensemble Project](http://www.ensemble.ac.uk/)) does this modification.

Many organisations produce RSS data feeds, so pick one and look at it in your web browser.  Your browser will probably create a simple visualisation of the data, so view the source code in the usual way (right-click etc) to take a peek at the underlying XML.

##Down to business!

In your favourite text editor create the following skelton file and save it ...BlueSlopeExample1.html.

```html
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <title>My Blue Slope Example 1</title>
            <!--Exhibit JS and other libraries-->
            <script type="text/javascript" src="http://api.simile-widgets.org/exhibit/2.2.0/exhibit-api.js"></script>
            <script type="text/javascript" src="http://api.simile-widgets.org/exhibit/2.2.0/extensions/time/time-extension.js" ></script>
            <script type="text/javascript" src="https://www.google.com/jsapi"></script>
            <script type="text/javascript" src="googlefeeds-importer.js"></script>
            <!--data-->
            <!--styles-->
             <link rel='stylesheet' href='http://www.simile-widgets.org/styles/common.css' type='text/css' />            
        </head>
        <body>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p>
            
            <!--lenses-->
            
            <!--display options-->
            
            <!--facets-->
            
            <!--list view-->
            
            <!--Search-->            
            
            <!--cloud view-->
            
            <!--Debug textarea-->
        </body>
    </html>
```
Download and save the [googlefeeds-importer.js](https://raw.githubusercontent.com/pwin/Hackdays/master/BlueSlopes/googlefeeds-importer.js) and [__history__.html](https://raw.githubusercontent.com/pwin/Hackdays/master/BlueSlopes/__history__.html) files in the same folder.

Open up your `BlueSlopeExample1.html` file in a web browser and confirm that  it loads without any errors.

Back to the editor now, and add two RSS feeds as Exhibit data sources just below the placemarker

```html
     <link 
     href="http://scottishgovernment.presscentre.com/rss/default.aspx?feedid={8d8b9894-a7c9-4afd-91f2-bcc7e2ea81f6}" 
     type="application/rss+xml" rel="exhibit/data" /> 
     <link 
     href="http://www.trafficscotland.org/rss/feeds/currentincidents.aspx" 
     type="application/rss+xml" rel="exhibit/data" /> 
```
{'fraction_non_alphanumeric': 0.11994742030890569, 'fraction_numerical': 0.008872822872165627, 'mean_word_length': 2.490252293577982, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 67, 'https://': 6, 'lorem ipsum': 0, 'www.': 10, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '83593', 'n_tokens_mistral': 1806, 'n_tokens_neox': 1709, 'n_words': 565}