Ping FeedBurner in a Django App

I have a django website and some of them are published through FeedBurner. I would like to ping FeedBurner whenever I save an instance of a specific model. FeedBurner says it uses the XML-RPC ping mechanism, but I can’t find a lot of documentation on how to implement it.

What is the easiest way to ping XML-RPC in django / Python?

+4
source share
3 answers

You can use the Django signals function to get a callback after saving the model:

 import xmlrpclib from django.db.models.signals import post_save from app.models import MyModel def ping_handler(sender, instance=None, **kwargs): if instance is None: return rpc = xmlrpclib.Server('http://ping.feedburner.google.com/') rpc.weblogUpdates.ping(instance.title, instance.get_absolute_url()) post_save.connect(ping_handler, sender=MyModel) 

Obviously, you should update this with what works for your application and read the signals in case you want another event.

+12
source

maybe so:

 import xmlrpclib j = xmlrpclib.Server('http://feedburnerrpc') reply = j.weblogUpdates.ping('website title','http://urltothenewpost') 
+1
source

All Articles