Making Graphs of DW Stats

From Dreamwidth Notes
Revision as of 23:28, 12 April 2009 by Foxfirefey (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

So, right now [info]foxfirefey has DW stats automatically downloaded and archived here:

http://noljads.com/dwstats/

Since the text files don't get updated, [info]sophie make a pipeline command that will make a CSV file of the HTML pages.

That can be used in Excel or R to make a graph of statistics:

library(zoo)

linecolors = c("navyblue", "blue", "skyblue2", "red")
linelabels = c("Active", "Updated in last 30 days", "Updated in last 7 days", "Updated in last 24 hours")

dwstats <- read.csv(file="stats.csv")
zoodwstats <- zoo(dwstats[,2:5], as.Date(as.character(dwstats[,1])))

onefile = TRUE

pdf(file=ifelse(onefile, "DWStatsGraph.pdf", "none"), width=12, height=8, title="Dreamwidth Stats")
plot(zoodwstats, main="Activity Statistics for Dreamwidth", plot.type="single", col=linecolors, xlab="Date", ylab="Number of accounts")
legend(x="topleft", linelabels, xjust=0.5, fill=linecolors, ncol=2, inset=0.2, title="Key")
dev.off()