<commit_before>A Sinatra app that retrieves machine-readable information from web pages and generates embed code if it's a known type.

Currently supports:

* YouTube videos (including 'short' format)
* Vimeo videos

Plans to include:

* Flickr
* Instagram
* SoundCloud
* Spotify
* Tomahawk
* Twitter

## Example
An example exists at http://gentle-stream-2944.herokuapp.com/ :

    GET http://gentle-stream-2944.herokuapp.com/?url=http://www.youtube.com/watch?v=1iYElrdil-M

### Returns:

    {
      "type": "youtube",
      "url":"http://www.youtube.com/watch?v=1iYElrdil-M",
      "title": "Save The Arts: An Important Message About the Arts by <NAME> - YouTube",
      "description": "<NAME>'s brilliant new video as part of Save The Arts, a new campaign by more than 100 leading UK artists urging the government not to cut arts fundi...",
      "id": "1iYElrdil-M",
      "embed_code": "&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/1iYElrdil-M&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;"
    }

Also supports JSONP given a callback param.

## Licence

(The MIT License)<commit_msg>Add acknowledgements and contribute instructions<commit_after>A Sinatra app that retrieves machine-readable information from web pages and generates embed code if it's a known type.

Currently supports:

* YouTube videos (including 'short' format)
* Vimeo videos

Plans to include:

* Flickr
* Instagram
* SoundCloud
* Spotify
* Tomahawk
* Twitter

## Example
A live (experimental) example exists at http://gentle-stream-2944.herokuapp.com/ :

    GET http://gentle-stream-2944.herokuapp.com/?url=http://www.youtube.com/watch?v=1iYElrdil-M

### Returns:

    {
      "type": "youtube",
      "url":"http://www.youtube.com/watch?v=1iYElrdil-M",
      "title": "Save The Arts: An Important Message About the Arts by <NAME> - YouTube",
      "description": "<NAME>'s brilliant new video as part of Save The Arts, a new campaign by more than 100 leading UK artists urging the government not to cut arts fundi...",
      "id": "1iYElrdil-M",
      "embed_code": "&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/1iYElrdil-M&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;"
    }

Also supports JSONP given a callback param.

## Contribute

Adding a new 'type' requires adding a new class that inherits from UrlResource, then adding the class name to the types array in `get.rb` (before `UrlResource`). The `PATTERN` constant is used to match the url. See any class in the `url_resources` directory for an example.

## Acknowledgments

Thanks to @samoli for getting me started with Sinatra/Ruby and for advice on structuring the project.

## Licence

(The MIT License)
{'fraction_non_alphanumeric': 0.1198421241478292, 'fraction_numerical': 0.015787585217079295, 'mean_word_length': 4.2209737827715355, 'pattern_counts': {'":': 12, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '585077', 'n_tokens_mistral': 927, 'n_tokens_neox': 863, 'n_words': 290}