Skip to content

Instantly share code, notes, and snippets.

#-*- coding:utf-8 -*-
#!/usr/bin/env python
import websocket
url="wss://rs1.sa8888.net:6125/?device=Web_main&token=Web_main_kvi4yxlses0tilzxok5y0jox/"
headers={
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"Cache-Control": "no-cache",
@coeric
coeric / pxmart.py
Created August 7, 2018 14:45
pxmart
#-*- coding:utf-8 -*-
#!/usr/bin/env python
import requests
import json
url="http://www.pxmart.com.tw/px/store1?cityid=&cityzoneid=&cityroadid=&name_short="
res=requests.get(url)
data=json.loads(res.content)
for row in data:
# print row
#-*- coding:utf-8 -*-
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
import re
import shutil
import os
out='/home/coericnb'
#-*- coding:utf-8 -*-
#!/usr/bin/env python
import zipfile
import urllib
dataid="F-D0047-093"
token="my_token"
url="http://opendata.cwb.gov.tw/opendataapi?dataid={}&authorizationkey={}".format(dataid,token)
urllib.urlretrieve(url,'temp.zip')
for file in zipfile.ZipFile('temp.zip',"r").namelist():