_, _, visitors = snippetText:find("<dd class=\"visitorsTotal\">(%d+)<")
if visitors then
  print("Total visitors: "..visitors)
  create {type="nt", text=visitors, title="Total blog visitors"}
else
  print "Number of total visitors not found"
endtest run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
| ID | Author/Program | Comment | Date | |
|---|---|---|---|---|
| 496 | #1000610 | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { _, _, visitors = snippetText:find("<dd class=\"visitorsTotal\">(%d+)<") if visitors then print("Total visitors: "..visitors) create {type="nt", text=visitors, title="Total blog visitors"} else print "Number of total visitors not found" end }} | 2015-08-18 18:30:22 | delete | 
| 494 | #1000604 (pitcher) | 2015-08-18 00:07:22 | ||
| 62 | stefan | WANT: hints on the variables (snippetText + ...?) | 2015-05-28 19:47:39 | 
| Snippet ID: | #547 | 
| Snippet name: | Extract number of total visitors | 
| Eternal ID of this version: | #547/1 | 
| Text MD5: | 99d10e223709c083ea63d22e593b4ff8 | 
| Author: | stefan | 
| Category: | |
| Type: | Lua code - Snippet-to-snippet | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2015-03-22 20:03:04 | 
| Source code size: | 251 bytes / 7 lines | 
| Pitched / IR pitched: | No / Yes | 
| Views / Downloads: | 2171 / 321 | 
| Referenced in: | [show references] |