Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 98 lines (77 sloc) 3.026 kb
62b27c6 @zedtux Added codeclimate Badge
authored
1 # Urss [![Build Status](https://secure.travis-ci.org/zedtux/urss.png)](http://travis-ci.org/zedtux/urss) [![Dependency Status](https://gemnasium.com/zedtux/urss.png)](http://gemnasium.com/zedtux/urss) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/zedtux/urss)
41dbbb5 @zedtux Initial commit
authored
2
3 URSS or Ultra RSS is another ruby library to parse Feed RSS that has been created because there was no existing one that support multiple media:content or media:thumbnail.
4
5 ## Installation
6
7 Add this line to your application's Gemfile:
8
9 gem 'urss'
10
11 And then execute:
12
13 $ bundle
14
15 Or install it yourself as:
16
17 $ gem install urss
18
19 ## Usage
20
4675c9c @zedtux Added RSS 2.0 example with medias
authored
21 ### Simple RSS
22
41dbbb5 @zedtux Initial commit
authored
23 ````ruby
24 rss = Urss.at("http://www.ruby-lang.org/en/feeds/news.rss")
25 rss.title
26 #=> "Ruby News"
27 rss.url
28 #=> "http://www.ruby-lang.org/en/feeds/news.rss/"
29 rss.description
30 #=> "The latest news from Ruby-Lang.org."
31 rss.updated_at
32 #=> ""
33 rss.entries.size
34 #=> 10
35 rss.entries.first.title
36 #=> "Ruby 1.9.3-p194 is released"
37 rss.entries.first.created_at
38 #=> "Fri, 20 Apr 2012 03:19:04 GMT"
39 rss.entries.first.url
40 #=> "http://www.ruby-lang.org/en/news/2012/04/20/ruby-1-9-3-p194-is-released/"
473ca15 @zedtux Added output of rss.entries.first.content into the README.md file
authored
41 rss.entries.first.content.truncate(200)
42 #=> "<p>Ruby 1.9.2-p320 is released.</p><p>This release include Security Fix for RubyGems: SSL server verification failure for remote repository.\nAnd many bugs are fixed in this release.</p> <h2><a name..."
41dbbb5 @zedtux Initial commit
authored
43 ````
44
4675c9c @zedtux Added RSS 2.0 example with medias
authored
45 ### RSS With medias
46
47 ````ruby
48 rss = Urss.at("http://api.flickr.com/services/feeds/photos_public.gne?id=90313708@N00&lang=en-us&format=rss_200")
49 rss.title
50 #=> "Uploads from CoolbieRe"
51 rss.updated_at
52 #=> "Mon, 23 Apr 2012 09:48:57 -0700"
53 rss.entries.first.title
54 #=> "vertical panorama"
55 rss.entries.first.medias.size
56 #=> 1
57 rss.entries.first.medias.first.title
58 #=> "vertical panorama"
59 rss.entries.first.medias.first.thumbnail_url
60 #=> http://farm9.staticflickr.com/8159/6960539484_56665aba46_s.jpg
61 rss.entries.first.medias.first.content_url
62 #=> http://farm9.staticflickr.com/8159/6960539484_56665aba46_b.jpg
63 ````
64
b0f1595 @zedtux Implemented Atom media and updated README.md
authored
65 ### Atom With medias
66
67 ````ruby
68 rss = Urss.at("http://api.flickr.com/services/feeds/photos_public.gne?id=90313708@N00&lang=en-us&format=atom")
69 rss.title
70 #=> "Uploads from CoolbieRe"
71 rss.updated_at
72 #=> "2012-04-23T16:48:57Z"
73 rss.entries.first.title
74 #=> "vertical panorama"
75 rss.entries.first.medias.size
76 #=> 1
77 rss.entries.first.medias.first.title
78 #=> nil
79 rss.entries.first.medias.first.thumbnail_url
80 #=> nil
81 rss.entries.first.medias.first.content_url
82 #=> http://farm9.staticflickr.com/8159/6960539484_56665aba46_b.jpg
83 ````
84
1c37b63 @zedtux Updated README.md in order to add the 'Reporting not working Feed' secti...
authored
85 ## Reporting not working Feed
86
87 If you encounter a Feed (RSS or Atom) where an attribute is not well parsed: Open an issue with a dump of the feed.
88
89 You can use `curl` to do this and post the output (Use [gists](https://gist.github.com/) if it is very long).
90
41dbbb5 @zedtux Initial commit
authored
91 ## Contributing
92
93 1. Fork it
94 2. Create your feature branch (`git checkout -b my-new-feature`)
95 3. Commit your changes (`git commit -am 'Added some feature'`)
96 4. Push to the branch (`git push origin my-new-feature`)
97 5. Create new Pull Request
Something went wrong with that request. Please try again.