automating twitter

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import twitter
from django.db.models.signals import post_save

def tweetit(sender,**kwargs):
    """
        extract relevant info and tweet it
        """
    if kwargs['created']:
        t = twitter.Api(settings.TWITTER_USER, settings.TWITTER_PASSWORD)
        t.PostUpdate("%s has registered as a delegate" %(kwargs['instance']))
    
post_save.connect(tweetit, sender=Delegate)

More like this

  1. Twitter status tag by gmacgregor 5 years, 3 months ago
  2. Changing field type in production by lawgon 6 years, 1 month ago
  3. Twitter template tags and filters by moxypark 2 years, 8 months ago
  4. Autogenerate admin classes in admin.py by dodgyville 4 years, 9 months ago
  5. Template tag: Last x twitter msgs of user by coulix 3 years, 10 months ago

Comments

(Forgotten your password?)