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
1=== modified file 'ibid/plugins/lookup.py'
2--- ibid/plugins/lookup.py 2009-05-08 11:46:31 +0000
3+++ ibid/plugins/lookup.py 2009-05-10 09:03:08 +0000
4@@ -228,19 +228,33 @@
5
6 @handler
7 def update(self, event, service, id):
8- event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update(service.lower(), int(id)))
9+ try:
10+ event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update(service.lower(), int(id)))
11+ except HTTPError, e:
12+ if e.code == 403:
13+ event.addresponse(u'That %s is private', service.lower() == 'twitter' and 'tweet' or service.lower())
14+ elif e.code == 404:
15+ event.addresponse(u'No such %s', service.lower() == 'twitter' and 'tweet' or service.lower())
16+ else:
17+ event.addresponse(u'I can only see the Fail Whale')
18
19 @handler
20 def latest(self, event, service, user):
21- event.addresponse(u'"%(text)s" %(ago)s ago, %(url)s', self.remote_latest(service.lower(), user))
22+ try:
23+ event.addresponse(u'"%(text)s" %(ago)s ago, %(url)s', self.remote_latest(service.lower(), user))
24+ except HTTPError, e:
25+ if e.code == 404:
26+ event.addresponse(u'No such microblogger')
27+ else:
28+ event.addresponse(u'I can only see the Fail Whale')
29
30 @match(r'^https?://(?:www\.)?twitter\.com/[^/ ]+/statuse?s?/(\d+)$')
31 def twitter(self, event, id):
32- event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update('twitter', int(id)))
33+ self.update(event, u'twitter', id)
34
35 @match(r'^https?://(?:www\.)?identi.ca/notice/(\d+)$')
36 def identica(self, event, id):
37- event.addresponse(u'%(screen_name)s: "%(text)s"', self.remote_update('identi.ca', int(id)))
38+ self.update(event, u'identica', id)
39
40 help['currency'] = u'Converts amounts between currencies.'
41 class Currency(Processor):

Subscribers

People subscribed via source and target branches