- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
#!/usr/bin/python
# encoding utf8
# head1 NAME
#
# wordpress - Number of wordpress sites currently active
#
# CONFIGURATION
#
# This script is used to generate data for the number of wordpress sites in the
# wild
#
# APPLICABLE SYSTEMS
#
# Any
#
# CONFIGURATION
#
# None
#
import sys, os, string, urllib2
from urllib2 import HTTPError
import socket
WORDPRESS_STATS_URL = "http://en.wordpress.com/stats/"
def get_stats():
contents=""
try:
socket.setdefaulttimeout(10)
response = urllib2.urlopen(WORDPRESS_STATS_URL)
contents = response.read()
except HTTPError, e:
sys.exit()
flipper = ""
splitter = contents.split()
for line in splitter:
if not line:
break
if line.find("stats-flipper-number") != -1:
flipper += line
flipper_number = ""
for f in flipper:
if(f.isdigit()):
flipper_number += f
print("BLOGS.value " + flipper_number)
if __name__ == "__main__":
# are we doing config/autoconfig?
if(len(sys.argv) > 1):
if (sys.argv[1]=="config"):
print "graph_title Number of Wordpress Blogs "
print "graph_vlabel Number Of Blogs"
print "graph_category wordpress"
# in green
print "BLOGS.label BLOGS"
print "BLOGS.colour 00cc00"
print "BLOGS.draw AREA"
print "graph_args --base 1000 "
sys.exit()
get_stats()
Комментарии (0) RSS
Добавить комментарий