Skip to content

Instantly share code, notes, and snippets.

@cfpg
Created May 21, 2010 00:42
Show Gist options
  • Save cfpg/408332 to your computer and use it in GitHub Desktop.
Save cfpg/408332 to your computer and use it in GitHub Desktop.
whos.amung.us plugin for ServerDensity
#!/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