... because from time to time I'm a web developer, too
About me
Projects
Contact
Links

Ping search engines via RPC in python

October 8, 2009 | python
author: Karol Zielinski | comments: 1 | views: 1463
Tags: , , , , ,

It’s always good idea to update different search engines that your blog or a websites has updated. The easiest possible way to do this is by pinging them via XML-RPC.

In python there is a great library called xmlrpclib, which will do it for us.

I will translate how it works on my site en.tspot.pl. I will ping pingomatic, which will send a ping to all the search engines.

So…

cd /home/workspace/tspot
vim main/models.py

and in class News (which is representation of news table in my database) I added method ‘save()’.


	def save(self):
		super(News, self).save()

		from xmlrpclib import ServerProxy

		server = ServerProxy('http://rpc.pingomatic.com/')
		try:
			server.weblogUpdates.ping('en.tspot.pl', 'http://en.tspot.pl/')
		except:
			pass

Ready.
Now, I just need to do some changes in existing newses or add new post… after that all the search engines will know about my updates.

Bookmark and Share
Post Ping search engines via RPC in python to develway Post Ping search engines via RPC in python to Delicious Post Ping search engines via RPC in python to Digg Post Ping search engines via RPC in python to Facebook Post Ping search engines via RPC in python to Reddit Post Ping search engines via RPC in python to StumbleUpon

Related news and resources

Comments (1)

4Avatars v0.3.1 v0.3.1
max
January 19, 2010, 5:16 pm

thanks for this code

Write a comment

Karol Zielinski :: Just a tech stuff Hello, I'm Karol Zielinski, internet evangelist, an entrepreneur, project manager and a web developer from Gdynia, Poland. I like creative design, good advertisement, social media and all kind of stuff around the web.

Most popular posts

Much more links

Karol Zielinski    |   contact me
Gdynia, Poland
RSS - Just a tech stuff - python, java blog - web development blog Karol Zielinski on twitter Karol Zielinski on LinkedIn Karol Zielinski on facebook Karol Zielinski on delicious Karol Zielinski on digg Karol Zielinski on flickr Karol Zielinski on stumbleupon Karol Zielinski on technorati