set entered_ping_google_url to contents of text field "tf_ping_google_path" of tab view item "tvi_ping_google" of tab view "tv_ping_google" of window "window"
set the_url to "http://www.google.com/webmasters/sitemaps/ping?sitemap=http://" & entered_ping_google_url & "/sitemap.xml"
open location the_url
it basically pings google that a sitemap has been updated.
the script is totally fine, but instead of actually opening safari and opening the page, can i just set it to “run” the page without opening safari. is that possible?
set entered_ping_google_url to contents of text field "tf_ping_google_path" of tab view item "tvi_ping_google" of tab view "tv_ping_google" of window "window"
set the_url to "http://www.google.com/webmasters/sitemaps/ping?sitemap=http://" & entered_ping_google_url & "/sitemap.xml"
do shell script "curl " & the_url
What StefanK suggested (almost) sends the proper request to Google. Getting back the HTML shouldn’t be a problem - you don’t have to do anything with it.
There’s a problem, though, when you use do shell script, you need to escape strings like URLs, especially if they have certain characters (like ampersand, quotes, question marks, and many others). So the code you need to use is:
do shell script "curl " & quoted form of the_url
That will properly escape the string - don’t try to put quotes around it yourself - use AppleScript’s built-in function quoted form of, as in my code above.
Browser: Safari 522) OmniWeb/v612.0.92598
Operating System: Mac OS X (10.4)