Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM Start of BASIC! Program
- cls
- console.title "abc2014バザール情報"
- socket.myip ip$
- if ip$="" then
- popup "ネットワーク未接続なので終了します。",0,0,1
- pause 4000
- exit
- else
- popup "ネットワーク接続済",0,0,1
- pause 4000
- endif
- popup " abc2014バザール情報 取得中",0,0,0
- pause 2000
- cls
- xm3$=" http://abc.android-group.jp/2014w/api/bazaar/"
- graburl aaa$,xm3$
- print aaa$
- console.save "abc2014.txt"
- cls
- htmlx$="<html><head><title>Result Page</title>\n"
- htmlx$=htmlx$+"<style type=\"text/css\">\n"
- htmlx$=htmlx$+"<!--\n"
- htmlx$=htmlx$+"#buttonx {\n"
- htmlx$=htmlx$+" width:300px;\n"
- htmlx$=htmlx$+" color:#ffffff;\n"
- htmlx$=htmlx$+" background:#337fcc;\n"
- htmlx$=htmlx$+" font-family: fantasy,sans-serif;\n"
- htmlx$=htmlx$+" font-size:24px;\n"
- htmlx$=htmlx$+" font-weight:bold;\n"
- htmlx$=htmlx$+" text-shadow:0 1px 0px #143352,0 2px 0px #143352;\n"
- htmlx$=htmlx$+" text-align:center;\n"
- htmlx$=htmlx$+" display:inline-block;\n"
- htmlx$=htmlx$+" text-decoration:none;\n"
- htmlx$=htmlx$+" border:1px solid #225588;\n"
- htmlx$=htmlx$+" padding:10px 0 8px 0;\n"
- htmlx$=htmlx$+" border-radius:5px;\n"
- htmlx$=htmlx$+" margin-bottom:20px;\n"
- htmlx$=htmlx$+"}\n"
- htmlx$=htmlx$+"-->\n"
- htmlx$=htmlx$+"</style>\n"
- htmlx$=htmlx$+ "</head>\n"
- htmlx$=htmlx$+"<script type=\"text/javascript\">\n"
- htmlx$=htmlx$+" function doDataLink(data) {\n"
- htmlx$=htmlx$+" Android.dataLink(data);\n"
- htmlx$=htmlx$+" }\n"
- htmlx$=htmlx$+"</script>\n"
- htmlx$=htmlx$+"<body bgcolor=\"azure\">\n"
- console.title "abc2014バザール情報 編集中"
- htmlx$=htmlx$+"<h1>abc2014バザール情報</h1>\n"
- htmlx$=htmlx$+"<a id=\"buttonx\" style=\"width:250px\" "
- htmlx$=htmlx$+" onmouseover=\"this.style.background='#43cd80'\" "
- htmlx$=htmlx$+" onmouseout=\"this.style.background='#337fcc'\" "
- htmlx$=htmlx$+" onclick=\"this.style.background='#43cd80';"
- htmlx$=htmlx$+"doDataLink('Exit')\" > 終 了 </a><br>\n"
- POPUP "XMLデータ編集中",0,0,1
- Text.open r, file_number, "abc2014.txt"
- while line$ <> "EOF"
- Text.readln file_number, line$
- out$=line$
- if is_in("<bazaarInfo updateDate=\"",line$)<>0 then
- out$=replace$(out$,"<bazaarInfo updateDate=\"","")
- out$=replace$(out$,"\">","")
- out$=replace$(out$," ","")
- htmlx$=htmlx$+"<BR>【データ更新日時】"+out$+"<hr><hr><br>"
- endif
- if is_in("<group>",line$)<>0 then
- out$=replace$(out$,"<group>","")
- out$=replace$(out$,"</group>","")
- out$=replace$(out$,"<![CDATA[","")
- out$=replace$(out$,"]]>","")
- out$=replace$(out$," ","")
- htmlx$=htmlx$+"【出品者】"+out$+"<br>"
- endif
- if is_in("<title>",line$)<>0 then
- out$=replace$(out$,"<title>","")
- out$=replace$(out$,"</title>","")
- out$=replace$(out$,"<![CDATA[","")
- out$=replace$(out$,"]]>","")
- out$=replace$(out$," ","")
- htmlx$=htmlx$+"【出品項目】"+out$+"<br>"
- endif
- if is_in("<content>",line$)<>0 then
- out$=replace$(out$,"<content>","")
- out$=replace$(out$,"</content>","")
- out$=replace$(out$,"<![CDATA[","")
- out$=replace$(out$,"]]>","")
- out$=replace$(out$," ","")
- htmlx$=htmlx$+"【出品内容】"+out$+"<br>"
- endif
- if is_in("<location>",line$)<>0 then
- out$=replace$(out$,"<location>","")
- out$=replace$(out$,"</location>","")
- out$=replace$(out$,"<![CDATA[","")
- out$=replace$(out$,"]]>","")
- out$=replace$(out$," ","")
- htmlx$=htmlx$+"【バザール会場内の場所;】"+out$+"<br>"
- htmlx$=htmlx$+"<hr><hr>"+"<br>"
- endif
- if is_in("<",line$)=0 then
- if is_in("EOF",line$)=0 then
- htmlx$=htmlx$+out$+"<br>"
- endif
- endif
- if is_in("<content>",line$)=0 then
- if is_in("</content>",line$)<>0 then
- out$=replace$(out$,"<content>","")
- out$=replace$(out$,"</content>","")
- out$=replace$(out$,"<![CDATA[","")
- out$=replace$(out$,"]]>","")
- out$=replace$(out$," ","")
- htmlx$=htmlx$+out$+"<br>"
- endif
- endif
- repeat
- Text.close file_number
- cls
- htmlx$=htmlx$+"<a id=\"buttonx\" style=\"width:250px\" "
- htmlx$=htmlx$+" onmouseover=\"this.style.background='#43cd80'\" "
- htmlx$=htmlx$+" onmouseout=\"this.style.background='#337fcc'\" "
- htmlx$=htmlx$+" onclick=\"this.style.background='#43cd80';"
- htmlx$=htmlx$+"doDataLink('Exit')\" > 終 了 </a><br>\n"
- htmlx$=htmlx$+"</body></html>"
- !print htmlx$
- xnextv:
- popup "HTMLデータロード中",0,0,0
- HTML.OPEN
- HTML.LOAD.string htmlx$
- xnextU:
- ! loop until data$ is not ""
- DO
- HTML.GET.DATALINK data$
- UNTIL data$ <> ""
- type$ = LEFT$(data$, 4)
- data$ = MID$(data$,5)
- ! Act on the data type
- ! Shown are all the current data types
- SW.BEGIN type$
- ! Back Key hit.
- ! if we can go back then do it
- SW.CASE "BAK:"
- PRINT "BACK key: " + data$
- html.close
- goto xnextv
- SW.BREAK
- ! A hyperlink was clicked on
- SW.CASE "LNK:"
- PRINT "Hyperlink selected: "+ data$
- popup "リンク先をロード中",0,0,0
- HTML.LOAD.URL data$
- SW.BREAK
- ! An error occured
- SW.CASE "ERR:"
- PRINT "Error: " + data$
- SW.BREAK
- ! User data returned
- SW.CASE "DAT:"
- PRINT "User data: " + data$
- ! Check for Exit
- IF data$ = "Exit"
- PRINT "User ended demo."
- HTML.CLOSE
- exit
- ENDIF
- SW.BREAK
- ! Form data returned.
- ! Note: Form data returning
- ! always exits the html.
- SW.CASE "FOR:"
- PRINT "Form data: "+data$
- end
- SW.BREAK
- SW.DEFAULT
- PRINT "Unexpected data type:", type$ + data$
- END
- SW.END
- GOTO xnextU
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement