Advertisement
Guest User

ABC 2014 Winter バザール情報簡易取得 BASIC!プログラム

a guest
Dec 16th, 2014
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.57 KB | None | 0 0
  1. REM Start of BASIC! Program
  2. cls
  3. console.title "abc2014バザール情報"
  4.  
  5. socket.myip ip$
  6. if ip$="" then
  7. popup "ネットワーク未接続なので終了します。",0,0,1
  8. pause 4000
  9. exit
  10. else
  11. popup "ネットワーク接続済",0,0,1
  12. pause 4000
  13. endif
  14.  
  15.  
  16. popup " abc2014バザール情報 取得中",0,0,0
  17. pause 2000
  18. cls
  19. xm3$=" http://abc.android-group.jp/2014w/api/bazaar/"
  20. graburl aaa$,xm3$
  21. print aaa$
  22. console.save "abc2014.txt"
  23. cls
  24.  
  25.  
  26.  
  27. htmlx$="<html><head><title>Result Page</title>\n"
  28.  
  29. htmlx$=htmlx$+"<style type=\"text/css\">\n"
  30. htmlx$=htmlx$+"<!--\n"
  31. htmlx$=htmlx$+"#buttonx {\n"
  32. htmlx$=htmlx$+" width:300px;\n"
  33. htmlx$=htmlx$+" color:#ffffff;\n"
  34. htmlx$=htmlx$+" background:#337fcc;\n"
  35. htmlx$=htmlx$+" font-family: fantasy,sans-serif;\n"
  36. htmlx$=htmlx$+" font-size:24px;\n"
  37. htmlx$=htmlx$+" font-weight:bold;\n"
  38. htmlx$=htmlx$+" text-shadow:0 1px 0px #143352,0 2px 0px #143352;\n"
  39. htmlx$=htmlx$+" text-align:center;\n"
  40. htmlx$=htmlx$+" display:inline-block;\n"
  41. htmlx$=htmlx$+" text-decoration:none;\n"
  42. htmlx$=htmlx$+" border:1px solid #225588;\n"
  43. htmlx$=htmlx$+" padding:10px 0 8px 0;\n"
  44. htmlx$=htmlx$+" border-radius:5px;\n"
  45. htmlx$=htmlx$+" margin-bottom:20px;\n"
  46. htmlx$=htmlx$+"}\n"
  47. htmlx$=htmlx$+"-->\n"
  48. htmlx$=htmlx$+"</style>\n"
  49.  
  50. htmlx$=htmlx$+ "</head>\n"
  51.  
  52.  
  53. htmlx$=htmlx$+"<script type=\"text/javascript\">\n"
  54. htmlx$=htmlx$+" function doDataLink(data) {\n"
  55. htmlx$=htmlx$+" Android.dataLink(data);\n"
  56. htmlx$=htmlx$+" }\n"
  57. htmlx$=htmlx$+"</script>\n"
  58. htmlx$=htmlx$+"<body bgcolor=\"azure\">\n"
  59.  
  60. console.title "abc2014バザール情報 編集中"
  61.  
  62. htmlx$=htmlx$+"<h1>abc2014バザール情報</h1>\n"
  63. htmlx$=htmlx$+"<a id=\"buttonx\" style=\"width:250px\" "
  64. htmlx$=htmlx$+" onmouseover=\"this.style.background='#43cd80'\" "
  65. htmlx$=htmlx$+" onmouseout=\"this.style.background='#337fcc'\" "
  66. htmlx$=htmlx$+" onclick=\"this.style.background='#43cd80';"
  67. htmlx$=htmlx$+"doDataLink('Exit')\" > 終 了 </a><br>\n"
  68.  
  69.  
  70. POPUP "XMLデータ編集中",0,0,1
  71.  
  72. Text.open r, file_number, "abc2014.txt"
  73. while line$ <> "EOF"
  74. Text.readln file_number, line$
  75. out$=line$
  76.  
  77. if is_in("<bazaarInfo updateDate=\"",line$)<>0 then
  78. out$=replace$(out$,"<bazaarInfo updateDate=\"","")
  79. out$=replace$(out$,"\">","")
  80. out$=replace$(out$," ","")
  81. htmlx$=htmlx$+"<BR>【データ更新日時】"+out$+"<hr><hr><br>"
  82. endif
  83.  
  84. if is_in("<group>",line$)<>0 then
  85. out$=replace$(out$,"<group>","")
  86. out$=replace$(out$,"</group>","")
  87. out$=replace$(out$,"<![CDATA[","")
  88. out$=replace$(out$,"]]>","")
  89. out$=replace$(out$," ","")
  90. htmlx$=htmlx$+"【出品者】"+out$+"<br>"
  91. endif
  92.  
  93. if is_in("<title>",line$)<>0 then
  94. out$=replace$(out$,"<title>","")
  95. out$=replace$(out$,"</title>","")
  96. out$=replace$(out$,"<![CDATA[","")
  97. out$=replace$(out$,"]]>","")
  98. out$=replace$(out$," ","")
  99. htmlx$=htmlx$+"【出品項目】"+out$+"<br>"
  100. endif
  101.  
  102. if is_in("<content>",line$)<>0 then
  103. out$=replace$(out$,"<content>","")
  104. out$=replace$(out$,"</content>","")
  105. out$=replace$(out$,"<![CDATA[","")
  106. out$=replace$(out$,"]]>","")
  107. out$=replace$(out$," ","")
  108. htmlx$=htmlx$+"【出品内容】"+out$+"<br>"
  109. endif
  110.  
  111. if is_in("<location>",line$)<>0 then
  112. out$=replace$(out$,"<location>","")
  113. out$=replace$(out$,"</location>","")
  114. out$=replace$(out$,"<![CDATA[","")
  115. out$=replace$(out$,"]]>","")
  116. out$=replace$(out$," ","")
  117. htmlx$=htmlx$+"【バザール会場内の場所;】"+out$+"<br>"
  118. htmlx$=htmlx$+"<hr><hr>"+"<br>"
  119. endif
  120.  
  121.  
  122. if is_in("<",line$)=0 then
  123. if is_in("EOF",line$)=0 then
  124. htmlx$=htmlx$+out$+"<br>"
  125. endif
  126. endif
  127.  
  128. if is_in("<content>",line$)=0 then
  129. if is_in("</content>",line$)<>0 then
  130. out$=replace$(out$,"<content>","")
  131. out$=replace$(out$,"</content>","")
  132. out$=replace$(out$,"<![CDATA[","")
  133. out$=replace$(out$,"]]>","")
  134. out$=replace$(out$," ","")
  135. htmlx$=htmlx$+out$+"<br>"
  136. endif
  137. endif
  138.  
  139.  
  140.  
  141. repeat
  142. Text.close file_number
  143.  
  144. cls
  145. htmlx$=htmlx$+"<a id=\"buttonx\" style=\"width:250px\" "
  146. htmlx$=htmlx$+" onmouseover=\"this.style.background='#43cd80'\" "
  147. htmlx$=htmlx$+" onmouseout=\"this.style.background='#337fcc'\" "
  148. htmlx$=htmlx$+" onclick=\"this.style.background='#43cd80';"
  149. htmlx$=htmlx$+"doDataLink('Exit')\" > 終 了 </a><br>\n"
  150. htmlx$=htmlx$+"</body></html>"
  151. !print htmlx$
  152.  
  153. xnextv:
  154.  
  155. popup "HTMLデータロード中",0,0,0
  156.  
  157.  
  158. HTML.OPEN
  159.  
  160.  
  161. HTML.LOAD.string htmlx$
  162.  
  163. xnextU:
  164.  
  165. ! loop until data$ is not ""
  166.  
  167. DO
  168. HTML.GET.DATALINK data$
  169. UNTIL data$ <> ""
  170.  
  171. type$ = LEFT$(data$, 4)
  172.  
  173. data$ = MID$(data$,5)
  174.  
  175. ! Act on the data type
  176. ! Shown are all the current data types
  177.  
  178. SW.BEGIN type$
  179.  
  180. ! Back Key hit.
  181. ! if we can go back then do it
  182. SW.CASE "BAK:"
  183. PRINT "BACK key: " + data$
  184. html.close
  185. goto xnextv
  186. SW.BREAK
  187.  
  188. ! A hyperlink was clicked on
  189. SW.CASE "LNK:"
  190. PRINT "Hyperlink selected: "+ data$
  191. popup "リンク先をロード中",0,0,0
  192. HTML.LOAD.URL data$
  193. SW.BREAK
  194.  
  195. ! An error occured
  196. SW.CASE "ERR:"
  197. PRINT "Error: " + data$
  198. SW.BREAK
  199.  
  200. ! User data returned
  201. SW.CASE "DAT:"
  202. PRINT "User data: " + data$
  203.  
  204. ! Check for Exit
  205. IF data$ = "Exit"
  206. PRINT "User ended demo."
  207. HTML.CLOSE
  208. exit
  209. ENDIF
  210. SW.BREAK
  211.  
  212. ! Form data returned.
  213. ! Note: Form data returning
  214. ! always exits the html.
  215.  
  216. SW.CASE "FOR:"
  217. PRINT "Form data: "+data$
  218. end
  219. SW.BREAK
  220.  
  221.  
  222.  
  223. SW.DEFAULT
  224. PRINT "Unexpected data type:", type$ + data$
  225. END
  226.  
  227. SW.END
  228.  
  229. GOTO xnextU
  230.  
  231.  
  232.  
  233. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement