Created
May 21, 2010 00:42
-
-
Save cfpg/408332 to your computer and use it in GitHub Desktop.
whos.amung.us plugin for ServerDensity
This file contains hidden or 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 | |
# | |
# whos.amung.us plugin for ServerDensity | |
# | |
import urllib2 | |
import re | |
class online: | |
def run(self): | |
online_url = "http://whos.amung.us/stats/YOUR SITE ID/" | |
pattern = "sitekey, '(.*)'" | |
web_file = urllib2.urlopen(online_url) | |
result = re.search(pattern, web_file.read()) | |
data = {'YOUR SITE NAME': result.group(1)} | |
return data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment