BitShares Forum
Other => Meta => Topic started by: speedy on August 25, 2014, 11:18:56 am
-
It would be really interesting to correlate the recent price rise to the forum membership.
-
(http://i.snag.gy/9GsYy.jpg)
Left one is registrations per day right one is cumulative.
289 is today 1 is day of first registration.
-
+5
-
+5% Awesome! This community rocks.
-
That clear bit of acceleration at the end looks very exciting :D
Is there some url that regenerates a more up-to-date graph? I would like to keep tabs on this.
-
This is the node/coffescript i was using to pull data from the forum and create a csv. You need to disable cookies in browser to get an up to date session id you can use. If you want to do it regularly you probably should change the url to sort by date of registration and always just poll the last page or something like that.
async = require "async"
cheerio = require "cheerio"
parsePage = (url, target) ->
setImmediate ->
request = require("https").get url, (response) ->
filedata = ""
response.on "data", (chunk) ->
filedata += chunk
response.on "end", ->
target (cheerio.load filedata)
url = "https://bitsharestalk.org/index.php?PHPSESSID=b330a0f58442be2a1e469f4436e&action=mlist;sort=real_name;start="
dates = []
async.timesSeries 195, (id, cb) ->
parsePage url+(id*30), ($) ->
$("tr td:nth-child(7)").each (i, v) ->
dates.push new Date($(v).text()) / 1000
cb()
, ->
max = 0
dates.forEach (date) ->
max = i if i > max
regByDay = {}
days = dates.map (i) ->
Math.floor (max-i)/84600
days.forEach (day) ->
regByDay[day] = 0 unless regByDay[day]
regByDay[day]++
list = ""
for k of regByDay
list += k + ";" + regByDay[k] + "\n"
console.log list
-
As you are not interested in unique users you could also just poll the members page once a day and read the number of total members there.