Jump to content

Open window (visit site) via php


doa24uk

Recommended Posts

Hi guys,

 

I want to simulate opening a window & actually visiting a site for the following url.

 

http://mysite.com/ping/?title=mytitle&blogurl=myurl&chk_weblogscom=on&chk_blogs=on

 

Alternatively, you can use xml-rpc to send the details but I don't think that's possible with php is it??

 

This would mean dynamically creating an xml file from a mysql database ... and I don't think that's possible

Link to comment
Share on other sites

I should be more specific.

 

This will be run as a cron job therefore no user integration / visual output is required ... the script simply needs to open the URL to send the ping.

 

I've found the following code that apparently works for classic ASP ... can anyone translate this to php??

 

 

function SendPing(byval strBlogName, byval strBlogUrl, byval strPageUrl, byval strFeedUrl)

‘ build ping XMLRPC call
strData = “<?xml version=”"1.0″”?>”
strData = strData & “<methodCall>”
strData = strData & “<methodName>weblogUpdates.extendedPing</methodName>”
strData = strData & “<params>”
strData = strData & “<param>”
strData = strData & “<value>” & strBlogName & “</value>”
strData = strData & “</param>”
strData = strData & “<param>”
strData = strData & “<value>” & strBlogUrl & “</value>”
strData = strData & “</param>”
strData = strData & “<param>”
strData = strData & “<value>” & strPageUrl & “</value>”
strData = strData & “</param>”
strData = strData & “<param>”
strData = strData & “<value>” & strFeedUrl & “</value>”
strData = strData & “</param>”
strData = strData & “</params>”
strData = strData & “</methodCall>”

‘ post to Pingomatic XMLRPC ping URL
set objHttp = Server.CreateObject(”MSXML2.ServerXMLHTTP”)
objHttp.open “POST”, “http://rpc.pingomatic.com/”, false
objHttp.setRequestHeader “Content-Type”, “text/xml”
objHttp.setRequestHeader “Content-Length”, len(strData)
objHttp.Send strData

‘ check response
if (objHttp.status = 200) then
strReturn = objHttp.responseText
end if

‘ release object
set objHttp = nothing

‘ passback
SendPing = strReturn

end function

strData = SendPing(”The Title Of Your Website”, “The URL of your website”, “The URL of the new article”, “The URL of your RSS feed”)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.