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
@@ -0,0 +1,15 @@
|
|
1
|
+
module Titi::Provider::ActivityStreams
|
2
|
+
|
3
|
+
# <link href="http://twitter.com/banksean/statuses/12244282580"
|
4
|
+
# type="text/xhtml" rel="via" title="Just saw a @cliqset #salmon @-mention interop demo by @jpanzer. Very neat stuff!">
|
5
|
+
# </link>
|
6
|
+
|
7
|
+
Link = ActivityStreamsStruct.new(
|
8
|
+
:href,
|
9
|
+
:title,
|
10
|
+
:rel,
|
11
|
+
:type
|
12
|
+
)
|
13
|
+
Link.class_eval do
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Titi::Provider::ActivityStreams
|
2
|
+
# ActivityStream object.
|
3
|
+
# We can't call them 'Object' (ruby has a class like that already :)
|
4
|
+
# http://activitystrea.ms/spec/1.0/atom-activity-01.html#activityobjectelement
|
5
|
+
Obj = ActivityStreamsStruct.new(
|
6
|
+
:id,
|
7
|
+
:title,
|
8
|
+
:content,
|
9
|
+
:link_alt,
|
10
|
+
:published,
|
11
|
+
:updated,
|
12
|
+
#
|
13
|
+
:author,
|
14
|
+
:object_type, # video, post, file
|
15
|
+
:vevent
|
16
|
+
)
|
17
|
+
Obj.class_eval do
|
18
|
+
end
|
19
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,49 @@
|
|
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
|
+
}) do |entry|
|
36
|
+
# entry.has_author user.name, user.url
|
37
|
+
# entry.has_obj do |activity_obj|
|
38
|
+
# activity_obj.id = id
|
39
|
+
# activity_obj.title = text
|
40
|
+
# activity_obj.published = created_at
|
41
|
+
# activity_obj.updated = created_at
|
42
|
+
# activity_obj.author = entry.author
|
43
|
+
# end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# Thank to "Cliqset":http://feedproxy.cliqset.com/feed/selection and Rob Dolin:
|
2
|
+
PROVIDERS = {
|
3
|
+
# Feeds from http://feedproxy.cliqset.com/feed/selection
|
4
|
+
# it uses straight-lowercased names, not underscored. We've gone underscored. Dunno which to choose
|
5
|
+
:social => %w[ AvatarsUnited Bebo Brightkite Friendster Friendfeed GamerDna Gather Hi5 Hyves Identica
|
6
|
+
Jaiku Multiply Netlog Plurk Raptr Skyrock Twitter ],
|
7
|
+
:blogging => %w[ Ameba Baidu Blogger Douban Livejournal Posterous Tumblr Wordpress Xanga ],
|
8
|
+
:bookmarking => %w[ Delicious Digg Diigo GoogleReader Hatena Meneame Mixx Newsvine Propeller Reddit Stumbleupon Twine ],
|
9
|
+
:music => %w[ Blipfm Buzznet Ilike Lastfm Pandora Zooomr ],
|
10
|
+
:video => %w[ TwelveSeconds Bliptv Cinchcast DailyMotion FunnyOrDie Hulu Joost Metacafe Qik Revver Vimeo Youtube ],
|
11
|
+
:photos => %w[ DeviantArt Flickr Fotolog MobyPicture Photobucket Picasa Photocase Slideshare Smotri Smugmug Visualizeus ],
|
12
|
+
:reviews => %w[ Blippr Corkd Flixster Goodreads Librarything Qype Readernaut Yelp ],
|
13
|
+
|
14
|
+
:activity_streams => %w[ Gowalla Myspace]
|
15
|
+
|
16
|
+
# # Not yet implemented, need example mappings -- want to help?
|
17
|
+
# :more_text_status => %w[ AIM WlMessenger ],
|
18
|
+
# :more_location => %w[ Foursquare Tripit UrbanSpoon Whirl ],
|
19
|
+
# :more_gaming => %w[ Zynga Playdom MsgrGames ],
|
20
|
+
# :more_social => %w[ Facebook LinkedIn Plaxo Xing ],
|
21
|
+
# :more_music => %w[ Zune ],
|
22
|
+
# :more_video => %w[ BuddyTv ],
|
23
|
+
# :more_photos => %w[ MetroFlog WlSkyDrive ],
|
24
|
+
# :more_blogging => %w[ TypePad MoveableType WlSpaces ],
|
25
|
+
}
|
26
|
+
|
27
|
+
FEEDPROXY_FEEDS = [
|
28
|
+
# %w[ customfeed weblogs posted ],
|
29
|
+
#
|
30
|
+
%w[ tweleveseconds videos posted ],
|
31
|
+
%w[ ameba weblogs posted ],
|
32
|
+
%w[ avatarsunited weblogs posted ],
|
33
|
+
%w[ baidu weblogs posted ],
|
34
|
+
%w[ bebo weblogs posted ],
|
35
|
+
%w[ blipfm songs posted ],
|
36
|
+
%w[ blippr reviews posted ],
|
37
|
+
%w[ bliptv videos posted ],
|
38
|
+
%w[ blogger weblogs posted ],
|
39
|
+
%w[ brightkite activity posted ],
|
40
|
+
%w[ buzznet weblogs posted ],
|
41
|
+
%w[ buzznet photos posted ],
|
42
|
+
%w[ buzznet videos posted ],
|
43
|
+
%w[ cinchcast media posted ],
|
44
|
+
%w[ corkd reviews posted ],
|
45
|
+
%w[ dailymotion videos posted ],
|
46
|
+
%w[ delicious bookmarks posted ],
|
47
|
+
%w[ deviantart weblogs posted ],
|
48
|
+
%w[ deviantart photos posted ],
|
49
|
+
%w[ deviantart photos favorited ],
|
50
|
+
%w[ digg bookmarks dugg ],
|
51
|
+
%w[ digg bookmarks favorited ],
|
52
|
+
%w[ digg bookmarks posted ],
|
53
|
+
%w[ digg images dugg ],
|
54
|
+
%w[ digg images favorited ],
|
55
|
+
%w[ digg images posted ],
|
56
|
+
%w[ digg videos dugg ],
|
57
|
+
%w[ digg videos favorited ],
|
58
|
+
%w[ digg videos posted ],
|
59
|
+
%w[ diigo bookmarks posted ],
|
60
|
+
%w[ douban weblogs posted ],
|
61
|
+
%w[ flickr media posted ],
|
62
|
+
%w[ flickr media favorited ],
|
63
|
+
%w[ flixster reviews posted ],
|
64
|
+
%w[ fotolog photos posted ],
|
65
|
+
%w[ fotolog photos favorited ],
|
66
|
+
%w[ friendfeed activity posted ],
|
67
|
+
%w[ friendster weblogs posted ],
|
68
|
+
%w[ funnyordie videos posted ],
|
69
|
+
%w[ funnyordie videos favorited ],
|
70
|
+
%w[ gamerdna notes posted ],
|
71
|
+
%w[ gather weblogs posted ],
|
72
|
+
%w[ goodreads reviews posted ],
|
73
|
+
%w[ googlereader bookmarks posted ],
|
74
|
+
%w[ hatena bookmarks posted ],
|
75
|
+
%w[ hatena bookmarks favorited ],
|
76
|
+
%w[ hi5 weblogs posted ],
|
77
|
+
%w[ hulu activity posted ],
|
78
|
+
%w[ hyves media posted ],
|
79
|
+
%w[ hyves weblogs posted ],
|
80
|
+
%w[ identica notes posted ],
|
81
|
+
%w[ ilike songs played ],
|
82
|
+
%w[ ilike songs favorited ],
|
83
|
+
%w[ jaiku notes posted ],
|
84
|
+
%w[ joost activity posted ],
|
85
|
+
%w[ joost videos favorited ],
|
86
|
+
%w[ lastfm songs played ],
|
87
|
+
%w[ lastfm songs favorited ],
|
88
|
+
%w[ lastfm weblogs posted ],
|
89
|
+
%w[ librarything reviews posted ],
|
90
|
+
%w[ livejournal weblogs posted ],
|
91
|
+
%w[ meneame bookmarks posted ],
|
92
|
+
%w[ meneame bookmarks favorited ],
|
93
|
+
%w[ metacafe videos posted ],
|
94
|
+
%w[ mixx bookmarks posted ],
|
95
|
+
%w[ mobypicture media posted ],
|
96
|
+
%w[ multiply activity posted ],
|
97
|
+
%w[ netlog photos posted ],
|
98
|
+
%w[ netlog weblogs posted ],
|
99
|
+
%w[ newsvine bookmarks posted ],
|
100
|
+
%w[ pandora songs favorited ],
|
101
|
+
%w[ photobucket media posted ],
|
102
|
+
%w[ photocase photos posted ],
|
103
|
+
%w[ picasa photos posted ],
|
104
|
+
%w[ plurk notes posted ],
|
105
|
+
%w[ posterous weblogs posted ],
|
106
|
+
%w[ propeller bookmarks posted ],
|
107
|
+
%w[ propeller bookmarks favorited ],
|
108
|
+
%w[ qik videos posted ],
|
109
|
+
%w[ qype reviews posted ],
|
110
|
+
%w[ raptr notes posted ],
|
111
|
+
%w[ readernaut activity posted ],
|
112
|
+
%w[ readernaut books read ],
|
113
|
+
%w[ reddit bookmarks posted ],
|
114
|
+
%w[ revver videos posted ],
|
115
|
+
%w[ skyrock weblogs posted ],
|
116
|
+
%w[ slideshare files posted ],
|
117
|
+
%w[ slideshare files favorited ],
|
118
|
+
%w[ smotri videos posted ],
|
119
|
+
%w[ smugmug photos posted ],
|
120
|
+
%w[ smugmug videos posted ],
|
121
|
+
%w[ stumbleupon weblogs posted ],
|
122
|
+
%w[ stumbleupon bookmarks favorited ],
|
123
|
+
%w[ tumblr weblogs posted ],
|
124
|
+
%w[ twine twine created ],
|
125
|
+
%w[ twine bookmarks posted ],
|
126
|
+
%w[ twitter notes posted ],
|
127
|
+
%w[ twitter notes favorited ],
|
128
|
+
%w[ vimeo videos posted ],
|
129
|
+
%w[ vimeo videos favorited ],
|
130
|
+
%w[ visualizeus photos favorited ],
|
131
|
+
%w[ wordpress weblogs posted ],
|
132
|
+
%w[ xanga weblogs posted ],
|
133
|
+
%w[ yelp reviews posted ],
|
134
|
+
%w[ youtube videos posted ],
|
135
|
+
%w[ youtube videos favorited ],
|
136
|
+
%w[ zooomr photos posted ],
|
137
|
+
]
|
138
|
+
|
139
|
+
# load './lib/titi/provider/list_of_providers.rb' ; pr = PROVIDERS.values.flatten.map(&:underscore).to_set ; ff = FEEDPROXY_FEEDS.map{|provider, obj, verb| provider }.uniq.sort.to_set
|
140
|
+
# p (ff - pr).sort ; p (pr - ff).sort
|
141
|
+
|
142
|
+
true
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -31,24 +31,27 @@ module Titi::Provider
|
|
31
31
|
# </activity:object>
|
32
32
|
# </entry>
|
33
33
|
#
|
34
|
-
def
|
35
|
-
ActivityStreams::
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
34
|
+
def to_activity_stream
|
35
|
+
ActivityStreams::Feed.adapt do |feed|
|
36
|
+
feed.has_entry(
|
37
|
+
:id => %Q{tag:twitter.com,2007:http://twitter.com/#{user.screen_name}/statuses/#{id}},
|
38
|
+
:title => text,
|
39
|
+
:content => text,
|
40
|
+
:published => created_at,
|
41
|
+
:verb => :post
|
42
|
+
) do |entry|
|
43
|
+
entry.has_author user.name, user.url
|
44
|
+
entry.has_obj do |activity_obj|
|
45
|
+
activity_obj.id = id
|
46
|
+
activity_obj.title = text
|
47
|
+
activity_obj.published = created_at
|
48
|
+
activity_obj.updated = created_at
|
49
|
+
activity_obj.author = entry.author
|
50
|
+
end
|
49
51
|
end
|
50
52
|
end
|
51
53
|
end
|
54
|
+
|
52
55
|
end
|
53
56
|
end
|
54
57
|
end
|
File without changes
|
File without changes
|
@@ -90,6 +90,7 @@ module Titi::Provider
|
|
90
90
|
Status.class_eval do
|
91
91
|
include Titi::Provider
|
92
92
|
include Titi::Adaptor
|
93
|
+
include Titi::Fetcher::Json
|
93
94
|
|
94
95
|
# virtual setter for user: If argument is not a Twitter::User, adapt it to
|
95
96
|
# be a user (assuming it is a hash or a hash_like.
|
@@ -99,19 +100,16 @@ module Titi::Provider
|
|
99
100
|
self[:user] = new_user
|
100
101
|
end
|
101
102
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
# @example
|
106
|
-
# tweet = Status.get(12233609555)
|
107
|
-
# tweet.text
|
108
|
-
# #=> "THANK GOODNESS THE LIBRARY OF CONGRESS HAS UNDERSTOOD THE IMPORTANCE OF MY TWEETS what do you mean others are getting in too"
|
109
|
-
#
|
110
|
-
def self.get status_id
|
111
|
-
raw_json_str = RestClient.get "http://twitter.com/statuses/show/#{status_id}.json"
|
112
|
-
raw_status = JSON.load(raw_json_str.to_s)
|
103
|
+
# Create a new status by fetching the given status_id via the 'statuses/show' API call
|
104
|
+
def self.fetch_status status_id
|
105
|
+
raw_status = get "http://twitter.com/statuses/show/#{status_id}.json"
|
113
106
|
adapt(raw_status)
|
114
107
|
end
|
108
|
+
|
109
|
+
def self.from_file filename
|
110
|
+
adapt(super(filename))
|
111
|
+
end
|
112
|
+
|
115
113
|
end
|
116
114
|
end
|
117
115
|
end
|