CONST SleepSet
= 0 'to sleep between each keyword so we can see them and read them CONST SaveTo
= "wiki.txt" '"SCRN:" to display to the screen, or insert a filename to save the list to disk
PRINT "DOWNLOAD STARTING" file$ = "QB64WikiList.txt"
'Increase the 2-second time limit here if you need to.
DownloadRSS "http://qb64.org/wiki/Keyword_Reference_-_Alphabetical", file$, 2
PRINT "DOWNLOAD FINISHED"
l = 0
finish$
= "<div id=" + CHR$(34) + "symbols" + CHR$(34) + "></div>"finish
= INSTR(temp$
, finish$
) 'No need to parse anything after we get down to the symbol section of the wiki page
l
= INSTR(l
, temp$
, "<li>") work$
= MID$(temp$
, l
+ 4, l2
- l
- 5) link$
= MID$(work$
, li1
+ 1, li2
- li1
- 1) IF INSTR(link$
, "&") THEN link$
= "Page does not exist yet." link$ = StripCRLF(link$)
k1
= INSTR(li2
+ 1, work$
, ">"): k2
= INSTR(k1
+ 1, work$
, "<") keyword$
= MID$(work$
, k1
+ 1, k2
- k1
- 1) keyword$ = StripCRLF(keyword$)
d
= INSTR(k2
+ 1, work$
, "<span"): d1
= INSTR(d
+ 1, work$
, ">"): d2
= INSTR(d1
+ 1, work$
, "</span") desc$
= MID$(work$
, d1
+ 1, d2
- d1
- 1) desc$ = StripCRLF(desc$)
PRINT #1, " http://qb64.org"; link$
l = l2 + 1
SUB DownloadRSS
(url$
, file$
, timelimit
) link$ = url$
e$
= CHR$(13) + CHR$(10) ' end of line characters x$ = "GET " + url3$ + " HTTP/1.1" + e$
x$ = x$ + "Host: " + url2$ + e$ + e$
head$ = ""
cont_type$ = ""
'The wiki seems to contain stray CRLF characters at the dangest spots.
'Why it has them, I don't know, but we need to filter them out so our information will load and display properly.
li1 = 0
l$
= LEFT$(text$
, li1
- 1) r$
= MID$(text$
, li1
+ 2) text$ = l$ + r$
'Also some of the descriptions and such contain links to different keywords.
'We want to just strip those links and use a normal word replacement for ease of display, since we're not going to be displaying in
'an html editor/viewer.
li1 = 0
li1
= INSTR(li1
+ 1, text$
, "<a href") li2
= INSTR(li1
+ 1, text$
, "</a>") li3
= INSTR(li1
+ 1, text$
, ">") l$
= LEFT$(text$
, li1
- 1) m$
= MID$(text$
, li3
+ 1, li2
- li3
- 1) r$
= MID$(text$
, li2
+ 4) text$ = l$ + m$ + r$
StripCRLF$ = text$