titi 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +23 -4
- data/VERSION +1 -1
- data/examples/twitter.rb +4 -12
- data/lib/titi.rb +6 -0
- data/lib/titi/fetcher.rb +5 -0
- data/lib/titi/fetcher/json.rb +32 -0
- data/lib/titi/provider.rb +0 -23
- data/lib/titi/provider/activity_streams.rb +10 -139
- data/lib/titi/provider/activity_streams/activity_streams_struct.rb +46 -0
- data/lib/titi/provider/activity_streams/actor.rb +11 -0
- data/lib/titi/provider/activity_streams/address.rb +11 -0
- data/lib/titi/provider/activity_streams/entry.rb +38 -0
- data/lib/titi/provider/activity_streams/feed.rb +25 -0
- data/lib/titi/provider/activity_streams/feed.xml.erb +13 -11
- data/lib/titi/provider/activity_streams/link.rb +15 -0
- data/lib/titi/provider/activity_streams/obj.rb +19 -0
- data/lib/titi/provider/ameba/.gitignore +0 -0
- data/lib/titi/provider/avatars_united/.gitignore +0 -0
- data/lib/titi/provider/baidu/.gitignore +0 -0
- data/lib/titi/provider/bebo/.gitignore +0 -0
- data/lib/titi/provider/blipfm/.gitignore +0 -0
- data/lib/titi/provider/blippr/.gitignore +0 -0
- data/lib/titi/provider/bliptv/.gitignore +0 -0
- data/lib/titi/provider/blogger/.gitignore +0 -0
- data/lib/titi/provider/brightkite/.gitignore +0 -0
- data/lib/titi/provider/buzznet/.gitignore +0 -0
- data/lib/titi/provider/cinchcast/.gitignore +0 -0
- data/lib/titi/provider/corkd/.gitignore +0 -0
- data/lib/titi/provider/daily_motion/.gitignore +0 -0
- data/lib/titi/provider/delicious/.gitignore +0 -0
- data/lib/titi/provider/deviant_art/.gitignore +0 -0
- data/lib/titi/provider/digg/.gitignore +0 -0
- data/lib/titi/provider/diigo/.gitignore +0 -0
- data/lib/titi/provider/douban/.gitignore +0 -0
- data/lib/titi/provider/flickr/.gitignore +0 -0
- data/lib/titi/provider/flixster/.gitignore +0 -0
- data/lib/titi/provider/fotolog/.gitignore +0 -0
- data/lib/titi/provider/friendfeed/.gitignore +0 -0
- data/lib/titi/provider/friendster/.gitignore +0 -0
- data/lib/titi/provider/funny_or_die/.gitignore +0 -0
- data/lib/titi/provider/gamer_dna/.gitignore +0 -0
- data/lib/titi/provider/gather/.gitignore +0 -0
- data/lib/titi/provider/generic_feed.rb +49 -0
- data/lib/titi/provider/generic_feed/.gitignore +0 -0
- data/lib/titi/provider/goodreads/.gitignore +0 -0
- data/lib/titi/provider/google_reader/.gitignore +0 -0
- data/lib/titi/provider/hatena/.gitignore +0 -0
- data/lib/titi/provider/hi5/.gitignore +0 -0
- data/lib/titi/provider/hulu/.gitignore +0 -0
- data/lib/titi/provider/hyves/.gitignore +0 -0
- data/lib/titi/provider/identica/.gitignore +0 -0
- data/lib/titi/provider/ilike/.gitignore +0 -0
- data/lib/titi/provider/jaiku/.gitignore +0 -0
- data/lib/titi/provider/joost/.gitignore +0 -0
- data/lib/titi/provider/lastfm/.gitignore +0 -0
- data/lib/titi/provider/librarything/.gitignore +0 -0
- data/lib/titi/provider/list_of_providers.rb +142 -0
- data/lib/titi/provider/livejournal/.gitignore +0 -0
- data/lib/titi/provider/meneame/.gitignore +0 -0
- data/lib/titi/provider/metacafe/.gitignore +0 -0
- data/lib/titi/provider/mixx/.gitignore +0 -0
- data/lib/titi/provider/moby_picture/.gitignore +0 -0
- data/lib/titi/provider/multiply/.gitignore +0 -0
- data/lib/titi/provider/netlog/.gitignore +0 -0
- data/lib/titi/provider/newsvine/.gitignore +0 -0
- data/lib/titi/provider/pandora/.gitignore +0 -0
- data/lib/titi/provider/photobucket/.gitignore +0 -0
- data/lib/titi/provider/photocase/.gitignore +0 -0
- data/lib/titi/provider/picasa/.gitignore +0 -0
- data/lib/titi/provider/plurk/.gitignore +0 -0
- data/lib/titi/provider/posterous/.gitignore +0 -0
- data/lib/titi/provider/propeller/.gitignore +0 -0
- data/lib/titi/provider/qik/.gitignore +0 -0
- data/lib/titi/provider/qype/.gitignore +0 -0
- data/lib/titi/provider/raptr/.gitignore +0 -0
- data/lib/titi/provider/readernaut/.gitignore +0 -0
- data/lib/titi/provider/reddit/.gitignore +0 -0
- data/lib/titi/provider/revver/.gitignore +0 -0
- data/lib/titi/provider/skyrock/.gitignore +0 -0
- data/lib/titi/provider/slideshare/.gitignore +0 -0
- data/lib/titi/provider/smotri/.gitignore +0 -0
- data/lib/titi/provider/smugmug/.gitignore +0 -0
- data/lib/titi/provider/stumbleupon/.gitignore +0 -0
- data/lib/titi/provider/tumblr/.gitignore +0 -0
- data/lib/titi/provider/twelve_seconds/.gitignore +0 -0
- data/lib/titi/provider/twine/.gitignore +0 -0
- data/lib/titi/provider/twitter.rb +18 -15
- data/lib/titi/provider/twitter/.gitignore +0 -0
- data/lib/titi/provider/{twitter_rss → twitter}/README.textile +0 -0
- data/lib/titi/provider/twitter/models.rb +9 -11
- data/lib/titi/provider/{twitter_rss/models.rb → twitter/rss_feed.rb} +9 -10
- data/lib/titi/provider/vimeo/.gitignore +0 -0
- data/lib/titi/provider/visualizeus/.gitignore +0 -0
- data/lib/titi/provider/wordpress/.gitignore +0 -0
- data/lib/titi/provider/xanga/.gitignore +0 -0
- data/lib/titi/provider/yelp/.gitignore +0 -0
- data/lib/titi/provider/zooomr/.gitignore +0 -0
- data/spec/data/provider/ameba/.gitignore +0 -0
- data/spec/data/provider/avatars_united/.gitignore +0 -0
- data/spec/data/provider/baidu/.gitignore +0 -0
- data/spec/data/provider/bebo/.gitignore +0 -0
- data/spec/data/provider/blipfm/.gitignore +0 -0
- data/spec/data/provider/blippr/.gitignore +0 -0
- data/spec/data/provider/bliptv/.gitignore +0 -0
- data/spec/data/provider/blogger/.gitignore +0 -0
- data/spec/data/provider/brightkite/.gitignore +0 -0
- data/spec/data/provider/buzznet/.gitignore +0 -0
- data/spec/data/provider/cinchcast/.gitignore +0 -0
- data/spec/data/provider/corkd/.gitignore +0 -0
- data/spec/data/provider/daily_motion/.gitignore +0 -0
- data/spec/data/provider/delicious/.gitignore +0 -0
- data/spec/data/provider/delicious/delicious_bookmarks-activity_streams.xml +440 -0
- data/spec/data/provider/delicious/delicious_bookmarks-raw_feed.xml +239 -0
- data/spec/data/provider/deviant_art/.gitignore +0 -0
- data/spec/data/provider/digg/.gitignore +0 -0
- data/spec/data/provider/diigo/.gitignore +0 -0
- data/spec/data/provider/douban/.gitignore +0 -0
- data/spec/data/provider/flickr/.gitignore +0 -0
- data/spec/data/provider/flickr/flickr_favorites-activity_streams.xml +1040 -0
- data/spec/data/provider/flickr/flickr_favorites-raw_rss.xml +557 -0
- data/spec/data/provider/flixster/.gitignore +0 -0
- data/spec/data/provider/fotolog/.gitignore +0 -0
- data/spec/data/provider/friendfeed/.gitignore +0 -0
- data/spec/data/provider/friendster/.gitignore +0 -0
- data/spec/data/provider/funny_or_die/.gitignore +0 -0
- data/spec/data/provider/gamer_dna/.gitignore +0 -0
- data/spec/data/provider/gather/.gitignore +0 -0
- data/spec/data/provider/generic_feed/.gitignore +0 -0
- data/spec/data/provider/goodreads/.gitignore +0 -0
- data/spec/data/provider/google_reader/.gitignore +0 -0
- data/spec/data/provider/hatena/.gitignore +0 -0
- data/spec/data/provider/hi5/.gitignore +0 -0
- data/spec/data/provider/hulu/.gitignore +0 -0
- data/spec/data/provider/hyves/.gitignore +0 -0
- data/spec/data/provider/identica/.gitignore +0 -0
- data/spec/data/provider/identica/identica_statuses-raw_feed.xml +465 -0
- data/spec/data/provider/ilike/.gitignore +0 -0
- data/spec/data/provider/jaiku/.gitignore +0 -0
- data/spec/data/provider/joost/.gitignore +0 -0
- data/spec/data/provider/lastfm/.gitignore +0 -0
- data/spec/data/provider/librarything/.gitignore +0 -0
- data/spec/data/provider/livejournal/.gitignore +0 -0
- data/spec/data/provider/meneame/.gitignore +0 -0
- data/spec/data/provider/metacafe/.gitignore +0 -0
- data/spec/data/provider/mixx/.gitignore +0 -0
- data/spec/data/provider/moby_picture/.gitignore +0 -0
- data/spec/data/provider/multiply/.gitignore +0 -0
- data/spec/data/provider/netlog/.gitignore +0 -0
- data/spec/data/provider/newsvine/.gitignore +0 -0
- data/spec/data/provider/pandora/.gitignore +0 -0
- data/spec/data/provider/photobucket/.gitignore +0 -0
- data/spec/data/provider/photocase/.gitignore +0 -0
- data/spec/data/provider/picasa/.gitignore +0 -0
- data/spec/data/provider/plurk/.gitignore +0 -0
- data/spec/data/provider/posterous/.gitignore +0 -0
- data/spec/data/provider/propeller/.gitignore +0 -0
- data/spec/data/provider/qik/.gitignore +0 -0
- data/spec/data/provider/qype/.gitignore +0 -0
- data/spec/data/provider/raptr/.gitignore +0 -0
- data/spec/data/provider/readernaut/.gitignore +0 -0
- data/spec/data/provider/reddit/.gitignore +0 -0
- data/spec/data/provider/revver/.gitignore +0 -0
- data/spec/data/provider/skyrock/.gitignore +0 -0
- data/spec/data/provider/slideshare/.gitignore +0 -0
- data/spec/data/provider/smotri/.gitignore +0 -0
- data/spec/data/provider/smugmug/.gitignore +0 -0
- data/spec/data/provider/stumbleupon/.gitignore +0 -0
- data/spec/data/provider/tumblr/.gitignore +0 -0
- data/spec/data/provider/tumblr/tumblr_posts-raw_feed.xml +150 -0
- data/spec/data/provider/twelve_seconds/.gitignore +0 -0
- data/spec/data/provider/twine/.gitignore +0 -0
- data/spec/data/provider/twitter/.gitignore +0 -0
- data/spec/data/provider/twitter/twitter-api_user_timeline-activity_streams.xml +27 -0
- data/spec/data/provider/twitter/twitter-api_user_timeline-raw_json.json +1 -0
- data/spec/data/provider/twitter/twitter_rss_user_timeline-activity_streams.xml +46 -0
- data/spec/data/provider/twitter/twitter_rss_user_timeline-raw_feed.xml +83 -0
- data/spec/data/provider/vimeo/.gitignore +0 -0
- data/spec/data/provider/visualizeus/.gitignore +0 -0
- data/spec/data/provider/wordpress/.gitignore +0 -0
- data/spec/data/provider/xanga/.gitignore +0 -0
- data/spec/data/provider/yelp/.gitignore +0 -0
- data/spec/data/provider/youtube/youtube_videos-activity_streams.xml +629 -0
- data/spec/data/provider/youtube/youtube_videos-raw_feed.xml +51 -0
- data/spec/data/provider/zooomr/.gitignore +0 -0
- data/spec/spec_helper.rb +3 -2
- data/spec/support/compare_to_standard_example.rb +17 -0
- data/spec/titi_spec.rb +8 -2
- data/titi.gemspec +179 -5
- metadata +180 -6
- 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
|