~ibid-core/ibid/old-trunk-pack-0.92

« back to all changes in this revision

Viewing changes to ibid/plugins/lookup.py

  • Committer: Stefano Rivera
  • Date: 2009-08-20 15:31:15 UTC
  • mfrom: (724.3.4 url-output-404159)
  • Revision ID: stefano@rivera.za.net-20090820153115-9rm5gtuuyeg0d8z4
Surround URLs in <brackets>, makes for slightly more parseable output
https://code.edge.launchpad.net/~stefanor/ibid/url-output-404159/+merge/9250

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
            )
169
169
            text = item.find('text').text
170
170
 
171
 
            return u'%s : %s' % (url, text)
 
171
            return u'<%s> %s' % (url, text)
172
172
 
173
173
    @match(r'^(?:fml\s+|http://www\.fmylife\.com/\S+/)(\d+|random|flop|top|last|love|money|kids|work|health|sex|miscellaneous)$')
174
174
    def fml(self, event, id):
249
249
 
250
250
        id, body = message
251
251
        if len(body) > 1:
252
 
            event.addresponse(u'http://textsfromlastnight.com/view/%i :', id)
 
252
            event.addresponse(u'<http://textsfromlastnight.com/view/%i>', id)
253
253
            for line in body:
254
254
                event.addresponse(line)
255
255
        else:
256
 
            event.addresponse(u'http://textsfromlastnight.com/view/%(id)i : %(body)s', {
 
256
            event.addresponse(u'<http://textsfromlastnight.com/view/%(id)i> %(body)s', {
257
257
                'id': id,
258
258
                'body': body[0],
259
259
            })
329
329
                return
330
330
 
331
331
        id, body = story
332
 
        event.addresponse(u'%(url)sstory.php?id=%(id)i : %(body)s', {
 
332
        event.addresponse(u'<%(url)sstory.php?id=%(id)i> %(body)s', {
333
333
            'url': url,
334
334
            'id': id,
335
335
            'body': body,
406
406
    def latest(self, event, service_name, user):
407
407
        service = self.services[service_name.lower()]
408
408
        try:
409
 
            event.addresponse(u'"%(text)s" %(ago)s ago, %(url)s', self.remote_latest(service, user))
 
409
            event.addresponse(u'"%(text)s" %(ago)s ago <%(url)s>', self.remote_latest(service, user))
410
410
        except HTTPError, e:
411
411
            if e.code in (401, 403):
412
412
                event.addresponse(u"Sorry, %s's feed is private", user)
814
814
        message = u'Show: %(Show Name)s. Premiered: %(Premiered)s. ' \
815
815
                    u'Latest Episode: %(Latest Episode)s. Next Episode: %(Next Episode)s. ' \
816
816
                    u'Airtime: %(Airtime)s on %(Network)s. Genres: %(Genres)s. ' \
817
 
                    u'Status: %(Status)s. - %(Show URL)s'
 
817
                    u'Status: %(Status)s. <%(Show URL)s>'
818
818
                    
819
819
        if not retr_info:
820
820
            event.addresponse(u"I can't find anything out about '%s'", show)