Last active
December 28, 2015 12:19
-
-
Save akira-cn/7499361 to your computer and use it in GitHub Desktop.
git ping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys | |
from xmlrpclib import ServerProxy | |
def main(): | |
url = sys.argv[1].strip() | |
if not url or not url.startswith('http://'): | |
print 'please enter a url!' | |
return | |
site_name = u'gitpress.org' | |
site_url = 'http://www.gitpress.org' | |
site_feed = 'http://www.gitpress.org/index/rss' | |
servers = { | |
'baidu ' : 'http://ping.baidu.com/ping/RPC2', | |
'google ' : 'http://blogsearch.google.com/ping/RPC2', | |
'pingomatic' : 'http://rpc.pingomatic.com/', | |
} | |
for (name, server) in servers.items(): | |
s = ServerProxy(server) | |
print name , ':', s.weblogUpdates.extendedPing(site_name, site_url, url, site_feed) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment