WebNumbr API
Simply change the url you use to access your numbr and you can do neat things.- All commands are seperated by .
- All parameters are wrapped by ()
- You can read the plugin sources
- Order of operations (all selectors, "do SQL", all operations, all formats, "do output")
| name | params | doc | example |
|---|---|---|---|
| default | Default is "all" | webnumbrs | |
| above | number=17 | Lower bound on value. Accepts any number that SQL can understand | yhoo.above(17) |
| all | Selects the whole data history | webnumbrs.all.print_r | |
| at | date=May 2 1984 | Exact match on date. Same as .latest.to(date).from(date) | webnumbrs.at(1234567890) |
| below | number=15 | Upper bound on value. Accepts any number that SQL can understand | yhoo.below(15) |
| from | date=May 2 1984 | Lower bound on date. Accepts unixtime or anything strtotime accepts. | webnumbrs.from(last week) |
| last | count=1 | Selects the last count entries. count defaults to 1 | webnumbrs.last(5).graph |
| latest | Selects the latest number. Equivilent to last(count=1) but will always return just a number. | webnumbrs.latest.text | |
| to | date=+1 day | Upper bound on date. Accepts unixtime or anything strtotime accepts. | webnumbrs.to(3 months ago) |
| name | params | doc | example |
|---|---|---|---|
| count | Simply counts the number of data points | webnumbrs.all.count.text | |
| debug | Turns on debug information. Changes return structure to {"debug":{},"data":[]} | webnumbrs.debug.print_r | |
| derivative | numtimes=1 | Performs the discrete derivative on the data. Good for seeing change in the data | webnumbrs.all.derivative.graph |
| join | Takes current data and creates array(name => data, param1_name = param1_data, ...) | .join(dji-nyse.all,nasdaq.all,yhoo.all).graph | |
| numbr | Shows all the numbr information.Changes return structure to {"numbr":{},"data":[]} | webnumbrs.numbr.print_r | |
| remote | url=http://webnumbr.com/numbrPlugins/operation/remote/remote_example.txt | Remote plugins. 3 inputs are passed in "c, data, params". Expects string for "data" or 2 outputs in json "c, data". Allowed params are url (the remote endpoint), and url_encoded (a percent encoded url if needed, which takes precedence). {"data":3.14159,"c":{"key":"value"}} | webnumbrs.remote(http://webnumbr.com/numbrPlugins/operation/remote/remote_example.txt) |
| sum | numtimes=1 | Sums up the numbers. | slashdot-poll-votes.sum |
| name | params | doc | example |
|---|---|---|---|
| default | A basic "Numbr Page" showing information on a numbr. Only really useful for numbrs without operations done on them. | webnumbrs | |
| coder | HTML interface to help you write numbr queries | ||
| csv | CSV. timestamp,value\n | webnumbrs.csv | |
| embed | Embed code. Uses javascript to keep the numbr current. | webnumbrs.all.graph.embed | |
| graph | Displays a graph. Great for combining with .all | webnumbrs.all.graph | |
| json | callback=cb | JSON. Good for AJAX requests | webnumbrs.from(yesterday).json |
| link | Renders your number as a link back here. Nice for embedding. | webnumbrs.latest.link | |
| print_r | PHP's print_r. Nice for seeing data with whitespace | webnumbrs.debug.print_r | |
| rss | count=10, all=true | Simple RSS feed | webnumbrs.rss |
| text | Raw text printout. Good for easy use of a single number | webnumbrs.latest.text | |
| xml | XML. Not recommended. Use only if required | webnumbrs.from(last week).xml |
