Merge lp:~stefanor/ibid/microblogging-374029 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Merged
Approved by: Stefano Rivera
Approved revision: 636
Merged at revision: 637
Proposed branch: lp:~stefanor/ibid/microblogging-374029
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~stefanor/ibid/microblogging-374029
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Michael Gorven Approve
Review via email: mp+6390@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefano Rivera (stefanor) wrote :

We had to include the fail whale

Revision history for this message
Michael Gorven (mgorven) wrote :

Looks fine. I think we want to change the service configuration to include the
name of a status update (identi.ca updates are apparently called "dents")
though.
 review approve

review: Approve
Revision history for this message
Stefano Rivera (stefanor) wrote :

> Looks fine. I think we want to change the service configuration to include the
> name of a status update (identi.ca updates are apparently called "dents")
> though.

Aha. Sensible idea. r636

636. By Stefano Rivera

Redo the microblogging services dictionary

Revision history for this message
Jonathan Hitchcock (vhata) wrote :

I'd prefer to call the "users" (nobody actually *says* 'microblogger').

But yeah.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ibid/plugins/lookup.py'
--- ibid/plugins/lookup.py 2009-05-08 11:46:31 +0000
+++ ibid/plugins/lookup.py 2009-05-10 09:03:08 +0000
@@ -228,19 +228,33 @@
228228
229 @handler229 @handler
230 def update(self, event, service, id):230 def update(self, event, service, id):
231 event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update(service.lower(), int(id)))231 try:
232 event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update(service.lower(), int(id)))
233 except HTTPError, e:
234 if e.code == 403:
235 event.addresponse(u'That %s is private', service.lower() == 'twitter' and 'tweet' or service.lower())
236 elif e.code == 404:
237 event.addresponse(u'No such %s', service.lower() == 'twitter' and 'tweet' or service.lower())
238 else:
239 event.addresponse(u'I can only see the Fail Whale')
232240
233 @handler241 @handler
234 def latest(self, event, service, user):242 def latest(self, event, service, user):
235 event.addresponse(u'"%(text)s" %(ago)s ago, %(url)s', self.remote_latest(service.lower(), user))243 try:
244 event.addresponse(u'"%(text)s" %(ago)s ago, %(url)s', self.remote_latest(service.lower(), user))
245 except HTTPError, e:
246 if e.code == 404:
247 event.addresponse(u'No such microblogger')
248 else:
249 event.addresponse(u'I can only see the Fail Whale')
236250
237 @match(r'^https?://(?:www\.)?twitter\.com/[^/ ]+/statuse?s?/(\d+)$')251 @match(r'^https?://(?:www\.)?twitter\.com/[^/ ]+/statuse?s?/(\d+)$')
238 def twitter(self, event, id):252 def twitter(self, event, id):
239 event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update('twitter', int(id)))253 self.update(event, u'twitter', id)
240254
241 @match(r'^https?://(?:www\.)?identi.ca/notice/(\d+)$')255 @match(r'^https?://(?:www\.)?identi.ca/notice/(\d+)$')
242 def identica(self, event, id):256 def identica(self, event, id):
243 event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update('identi.ca', int(id)))257 self.update(event, u'identica', id)
244258
245help['currency'] = u'Converts amounts between currencies.'259help['currency'] = u'Converts amounts between currencies.'
246class Currency(Processor):260class Currency(Processor):

Subscribers

People subscribed via source and target branches