Commits

Gregory Petukhov  committed 845de43

Change form of message

  • Participants
  • Parent commits 117d306

Comments (0)

Files changed (1)

 import xmpp
 import time
 import logging
+from urlparse import urlsplit
 
 import settings
 import shorturl
         message = []
         for item in items[start:start + step]:
             link = shorturl.get(item['link'])
-            message.append(u'%s %s' % (item['title'], link))
+            host = urlsplit(item['link']).hostname
+            message.append(u'%s %s (%s)' % (item['title'], link, host))
         message = '\n'.join(message)
         client.send(xmpp.Message(to=settings.NOTIFY_ROOM, typ='groupchat', body=message))
         time.sleep(settings.MESSAGE_DELAY)