How do I ping a website using php? – PHP

  php

Q(Question):

The WordPress blog software does an antomatic ping to several directories and search engines everytime you add a new post.

I have written my own CMS and want to include this feature, but I have not got a clue how they do it. 🙁

What I want to to do is send the ping after I have updtaed the database.

Does anyone know how I would do this ?

A(Answer):

do you mean the shell command ping or a pingback?

A(Answer):

To be honest, I don’t know what they use.
That is really part of the question.

I just know that part of the WordPress blog software (which appears to be all in php) allows you to enter a list of sites to ping and therefore update their indexes.
I think that the ping just gets them to send a bot over to your website to crawl it.

Here is an example from Technorati

After you’re a Technorati member and your blog platform doesn’t already ping Technorati, you can configure your blog software to ping Technorati automatically by entering http://rpc.technorati.com/rpc/ping into your blog’s configuration.

So what I want to do is find out what wordpress actually does with that kind of url.

Whatever it does, I want to do it each time I update my CMS with a new post.

Here is an image which shows the WordPress interface:

I hope someone can help 🙂

A(Answer):

You can ping to other websites like technorati by writing down your own "XML-RPC" client application. most of the blogging platforms has in built tools for this, but since you have written your own CMS tool you may need to create your own XML RPC client for that. here is an example of how to do it for technorati.

http://techchorus.net/xml-rpc-client…ing-technorati

And if you need to ping to other services, then you should modify the coding accordingly. I think you are not the first person who willing to do this. So why don’t you first go to "phpclasses.org" and find it there. good luck with your work.

A(Answer):

I just read the info on Goggle Sitemaps Generator.

It looks like the best thing for me to do will be to download that and insatll it on my server. Looks like it will do everything and I don’t need to write this stuff myself ?

It looks to me like it keeps it up to date by looking for new pages from traffic. So after a new post is enetered all I have to do is look at the post ( which I would do anyway) and then it will be in the site map.

Here is the page ref: http://googlesitemapgenerator.google…gsg-intro.html

What do you think ?

A(Answer):

Link is broken, should be:
http://googlesitemapgenerator.google…gsg-intro.html

I think this is what you want rather than doing everything else. It is good and is already automated so that you shouldn’t have to do anything. If you do install it and try it, let us know what it’s like so others can benefit from your experience.

There are lots of other sitemap scripts, so maybe look around if you’re interested, but I’m sure Google’s one is good… I imagine that for google searching it is the best??

A(Answer):

I thought your requirement was updating other websites when you put new contents to your website.

So if you don’t mind I’d like to explain this.

Sitemap doesn’t ping or notify other websites. Sitemap will only help for the Search engine crawlers to find the site contents easily and that is only after they (crawlers) come to your website.

Websites like Tecnorati are blog search engines. There are more like this:
http://en.wikipedia.org/wiki/List_of_search_engines
If you need to update your website contents on them, you should do it as i said before. or else you can wait until the crawlers comes to see your sitemap.

LEAVE A COMMENT