titi 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. data/README.textile +23 -4
  2. data/VERSION +1 -1
  3. data/examples/twitter.rb +4 -12
  4. data/lib/titi.rb +6 -0
  5. data/lib/titi/fetcher.rb +5 -0
  6. data/lib/titi/fetcher/json.rb +32 -0
  7. data/lib/titi/provider.rb +0 -23
  8. data/lib/titi/provider/activity_streams.rb +10 -139
  9. data/lib/titi/provider/activity_streams/activity_streams_struct.rb +46 -0
  10. data/lib/titi/provider/activity_streams/actor.rb +11 -0
  11. data/lib/titi/provider/activity_streams/address.rb +11 -0
  12. data/lib/titi/provider/activity_streams/entry.rb +38 -0
  13. data/lib/titi/provider/activity_streams/feed.rb +25 -0
  14. data/lib/titi/provider/activity_streams/feed.xml.erb +13 -11
  15. data/lib/titi/provider/activity_streams/link.rb +15 -0
  16. data/lib/titi/provider/activity_streams/obj.rb +19 -0
  17. data/lib/titi/provider/ameba/.gitignore +0 -0
  18. data/lib/titi/provider/avatars_united/.gitignore +0 -0
  19. data/lib/titi/provider/baidu/.gitignore +0 -0
  20. data/lib/titi/provider/bebo/.gitignore +0 -0
  21. data/lib/titi/provider/blipfm/.gitignore +0 -0
  22. data/lib/titi/provider/blippr/.gitignore +0 -0
  23. data/lib/titi/provider/bliptv/.gitignore +0 -0
  24. data/lib/titi/provider/blogger/.gitignore +0 -0
  25. data/lib/titi/provider/brightkite/.gitignore +0 -0
  26. data/lib/titi/provider/buzznet/.gitignore +0 -0
  27. data/lib/titi/provider/cinchcast/.gitignore +0 -0
  28. data/lib/titi/provider/corkd/.gitignore +0 -0
  29. data/lib/titi/provider/daily_motion/.gitignore +0 -0
  30. data/lib/titi/provider/delicious/.gitignore +0 -0
  31. data/lib/titi/provider/deviant_art/.gitignore +0 -0
  32. data/lib/titi/provider/digg/.gitignore +0 -0
  33. data/lib/titi/provider/diigo/.gitignore +0 -0
  34. data/lib/titi/provider/douban/.gitignore +0 -0
  35. data/lib/titi/provider/flickr/.gitignore +0 -0
  36. data/lib/titi/provider/flixster/.gitignore +0 -0
  37. data/lib/titi/provider/fotolog/.gitignore +0 -0
  38. data/lib/titi/provider/friendfeed/.gitignore +0 -0
  39. data/lib/titi/provider/friendster/.gitignore +0 -0
  40. data/lib/titi/provider/funny_or_die/.gitignore +0 -0
  41. data/lib/titi/provider/gamer_dna/.gitignore +0 -0
  42. data/lib/titi/provider/gather/.gitignore +0 -0
  43. data/lib/titi/provider/generic_feed.rb +49 -0
  44. data/lib/titi/provider/generic_feed/.gitignore +0 -0
  45. data/lib/titi/provider/goodreads/.gitignore +0 -0
  46. data/lib/titi/provider/google_reader/.gitignore +0 -0
  47. data/lib/titi/provider/hatena/.gitignore +0 -0
  48. data/lib/titi/provider/hi5/.gitignore +0 -0
  49. data/lib/titi/provider/hulu/.gitignore +0 -0
  50. data/lib/titi/provider/hyves/.gitignore +0 -0
  51. data/lib/titi/provider/identica/.gitignore +0 -0
  52. data/lib/titi/provider/ilike/.gitignore +0 -0
  53. data/lib/titi/provider/jaiku/.gitignore +0 -0
  54. data/lib/titi/provider/joost/.gitignore +0 -0
  55. data/lib/titi/provider/lastfm/.gitignore +0 -0
  56. data/lib/titi/provider/librarything/.gitignore +0 -0
  57. data/lib/titi/provider/list_of_providers.rb +142 -0
  58. data/lib/titi/provider/livejournal/.gitignore +0 -0
  59. data/lib/titi/provider/meneame/.gitignore +0 -0
  60. data/lib/titi/provider/metacafe/.gitignore +0 -0
  61. data/lib/titi/provider/mixx/.gitignore +0 -0
  62. data/lib/titi/provider/moby_picture/.gitignore +0 -0
  63. data/lib/titi/provider/multiply/.gitignore +0 -0
  64. data/lib/titi/provider/netlog/.gitignore +0 -0
  65. data/lib/titi/provider/newsvine/.gitignore +0 -0
  66. data/lib/titi/provider/pandora/.gitignore +0 -0
  67. data/lib/titi/provider/photobucket/.gitignore +0 -0
  68. data/lib/titi/provider/photocase/.gitignore +0 -0
  69. data/lib/titi/provider/picasa/.gitignore +0 -0
  70. data/lib/titi/provider/plurk/.gitignore +0 -0
  71. data/lib/titi/provider/posterous/.gitignore +0 -0
  72. data/lib/titi/provider/propeller/.gitignore +0 -0
  73. data/lib/titi/provider/qik/.gitignore +0 -0
  74. data/lib/titi/provider/qype/.gitignore +0 -0
  75. data/lib/titi/provider/raptr/.gitignore +0 -0
  76. data/lib/titi/provider/readernaut/.gitignore +0 -0
  77. data/lib/titi/provider/reddit/.gitignore +0 -0
  78. data/lib/titi/provider/revver/.gitignore +0 -0
  79. data/lib/titi/provider/skyrock/.gitignore +0 -0
  80. data/lib/titi/provider/slideshare/.gitignore +0 -0
  81. data/lib/titi/provider/smotri/.gitignore +0 -0
  82. data/lib/titi/provider/smugmug/.gitignore +0 -0
  83. data/lib/titi/provider/stumbleupon/.gitignore +0 -0
  84. data/lib/titi/provider/tumblr/.gitignore +0 -0
  85. data/lib/titi/provider/twelve_seconds/.gitignore +0 -0
  86. data/lib/titi/provider/twine/.gitignore +0 -0
  87. data/lib/titi/provider/twitter.rb +18 -15
  88. data/lib/titi/provider/twitter/.gitignore +0 -0
  89. data/lib/titi/provider/{twitter_rss → twitter}/README.textile +0 -0
  90. data/lib/titi/provider/twitter/models.rb +9 -11
  91. data/lib/titi/provider/{twitter_rss/models.rb → twitter/rss_feed.rb} +9 -10
  92. data/lib/titi/provider/vimeo/.gitignore +0 -0
  93. data/lib/titi/provider/visualizeus/.gitignore +0 -0
  94. data/lib/titi/provider/wordpress/.gitignore +0 -0
  95. data/lib/titi/provider/xanga/.gitignore +0 -0
  96. data/lib/titi/provider/yelp/.gitignore +0 -0
  97. data/lib/titi/provider/zooomr/.gitignore +0 -0
  98. data/spec/data/provider/ameba/.gitignore +0 -0
  99. data/spec/data/provider/avatars_united/.gitignore +0 -0
  100. data/spec/data/provider/baidu/.gitignore +0 -0
  101. data/spec/data/provider/bebo/.gitignore +0 -0
  102. data/spec/data/provider/blipfm/.gitignore +0 -0
  103. data/spec/data/provider/blippr/.gitignore +0 -0
  104. data/spec/data/provider/bliptv/.gitignore +0 -0
  105. data/spec/data/provider/blogger/.gitignore +0 -0
  106. data/spec/data/provider/brightkite/.gitignore +0 -0
  107. data/spec/data/provider/buzznet/.gitignore +0 -0
  108. data/spec/data/provider/cinchcast/.gitignore +0 -0
  109. data/spec/data/provider/corkd/.gitignore +0 -0
  110. data/spec/data/provider/daily_motion/.gitignore +0 -0
  111. data/spec/data/provider/delicious/.gitignore +0 -0
  112. data/spec/data/provider/delicious/delicious_bookmarks-activity_streams.xml +440 -0
  113. data/spec/data/provider/delicious/delicious_bookmarks-raw_feed.xml +239 -0
  114. data/spec/data/provider/deviant_art/.gitignore +0 -0
  115. data/spec/data/provider/digg/.gitignore +0 -0
  116. data/spec/data/provider/diigo/.gitignore +0 -0
  117. data/spec/data/provider/douban/.gitignore +0 -0
  118. data/spec/data/provider/flickr/.gitignore +0 -0
  119. data/spec/data/provider/flickr/flickr_favorites-activity_streams.xml +1040 -0
  120. data/spec/data/provider/flickr/flickr_favorites-raw_rss.xml +557 -0
  121. data/spec/data/provider/flixster/.gitignore +0 -0
  122. data/spec/data/provider/fotolog/.gitignore +0 -0
  123. data/spec/data/provider/friendfeed/.gitignore +0 -0
  124. data/spec/data/provider/friendster/.gitignore +0 -0
  125. data/spec/data/provider/funny_or_die/.gitignore +0 -0
  126. data/spec/data/provider/gamer_dna/.gitignore +0 -0
  127. data/spec/data/provider/gather/.gitignore +0 -0
  128. data/spec/data/provider/generic_feed/.gitignore +0 -0
  129. data/spec/data/provider/goodreads/.gitignore +0 -0
  130. data/spec/data/provider/google_reader/.gitignore +0 -0
  131. data/spec/data/provider/hatena/.gitignore +0 -0
  132. data/spec/data/provider/hi5/.gitignore +0 -0
  133. data/spec/data/provider/hulu/.gitignore +0 -0
  134. data/spec/data/provider/hyves/.gitignore +0 -0
  135. data/spec/data/provider/identica/.gitignore +0 -0
  136. data/spec/data/provider/identica/identica_statuses-raw_feed.xml +465 -0
  137. data/spec/data/provider/ilike/.gitignore +0 -0
  138. data/spec/data/provider/jaiku/.gitignore +0 -0
  139. data/spec/data/provider/joost/.gitignore +0 -0
  140. data/spec/data/provider/lastfm/.gitignore +0 -0
  141. data/spec/data/provider/librarything/.gitignore +0 -0
  142. data/spec/data/provider/livejournal/.gitignore +0 -0
  143. data/spec/data/provider/meneame/.gitignore +0 -0
  144. data/spec/data/provider/metacafe/.gitignore +0 -0
  145. data/spec/data/provider/mixx/.gitignore +0 -0
  146. data/spec/data/provider/moby_picture/.gitignore +0 -0
  147. data/spec/data/provider/multiply/.gitignore +0 -0
  148. data/spec/data/provider/netlog/.gitignore +0 -0
  149. data/spec/data/provider/newsvine/.gitignore +0 -0
  150. data/spec/data/provider/pandora/.gitignore +0 -0
  151. data/spec/data/provider/photobucket/.gitignore +0 -0
  152. data/spec/data/provider/photocase/.gitignore +0 -0
  153. data/spec/data/provider/picasa/.gitignore +0 -0
  154. data/spec/data/provider/plurk/.gitignore +0 -0
  155. data/spec/data/provider/posterous/.gitignore +0 -0
  156. data/spec/data/provider/propeller/.gitignore +0 -0
  157. data/spec/data/provider/qik/.gitignore +0 -0
  158. data/spec/data/provider/qype/.gitignore +0 -0
  159. data/spec/data/provider/raptr/.gitignore +0 -0
  160. data/spec/data/provider/readernaut/.gitignore +0 -0
  161. data/spec/data/provider/reddit/.gitignore +0 -0
  162. data/spec/data/provider/revver/.gitignore +0 -0
  163. data/spec/data/provider/skyrock/.gitignore +0 -0
  164. data/spec/data/provider/slideshare/.gitignore +0 -0
  165. data/spec/data/provider/smotri/.gitignore +0 -0
  166. data/spec/data/provider/smugmug/.gitignore +0 -0
  167. data/spec/data/provider/stumbleupon/.gitignore +0 -0
  168. data/spec/data/provider/tumblr/.gitignore +0 -0
  169. data/spec/data/provider/tumblr/tumblr_posts-raw_feed.xml +150 -0
  170. data/spec/data/provider/twelve_seconds/.gitignore +0 -0
  171. data/spec/data/provider/twine/.gitignore +0 -0
  172. data/spec/data/provider/twitter/.gitignore +0 -0
  173. data/spec/data/provider/twitter/twitter-api_user_timeline-activity_streams.xml +27 -0
  174. data/spec/data/provider/twitter/twitter-api_user_timeline-raw_json.json +1 -0
  175. data/spec/data/provider/twitter/twitter_rss_user_timeline-activity_streams.xml +46 -0
  176. data/spec/data/provider/twitter/twitter_rss_user_timeline-raw_feed.xml +83 -0
  177. data/spec/data/provider/vimeo/.gitignore +0 -0
  178. data/spec/data/provider/visualizeus/.gitignore +0 -0
  179. data/spec/data/provider/wordpress/.gitignore +0 -0
  180. data/spec/data/provider/xanga/.gitignore +0 -0
  181. data/spec/data/provider/yelp/.gitignore +0 -0
  182. data/spec/data/provider/youtube/youtube_videos-activity_streams.xml +629 -0
  183. data/spec/data/provider/youtube/youtube_videos-raw_feed.xml +51 -0
  184. data/spec/data/provider/zooomr/.gitignore +0 -0
  185. data/spec/spec_helper.rb +3 -2
  186. data/spec/support/compare_to_standard_example.rb +17 -0
  187. data/spec/titi_spec.rb +8 -2
  188. data/titi.gemspec +179 -5
  189. metadata +180 -6
  190. data/lib/titi/provider/generic_rss.rb +0 -50
@@ -1,50 +0,0 @@
1
- module Titi::Provider
2
- module GenericRss
3
-
4
- class Feed
5
- attr_accessor :rss
6
- def initialize rss
7
- self.rss = rss
8
- end
9
-
10
- def get_via_feedzirra url
11
-
12
- end
13
-
14
- def get_via_restclient_crack url
15
- rss_xml = RestClient.get(url) ;
16
- raw_feed = Crack::XML.parse(rss_xml.to_s) ; rss = raw_feed['rss'].to_mash
17
- end
18
-
19
- def self.get url
20
- new Feedzirra::Feed.fetch_and_parse(url)
21
- end
22
-
23
- def entry
24
- rss.entries.first
25
- end
26
-
27
- def to_activity_stream_entry
28
- ActivityStreams::Entry.adapt(
29
- :activity_verb => :post,
30
- :id => entry.entry_id,
31
- :title => entry.title,
32
- :content => entry.summary,
33
- :summary => entry.summary,
34
- :published => entry.published,
35
- :link_
36
- ) do |entry|
37
- entry.has_author user.name, user.url
38
- entry.has_obj do |activity_obj|
39
- activity_obj.id = id
40
- activity_obj.title = text
41
- activity_obj.published = created_at
42
- activity_obj.updated = created_at
43
- activity_obj.author = entry.author
44
- end
45
- end
46
-
47
- end
48
- end
49
- end
50
- end