Skip to content

Commit 166663e

Browse files
committed
renamed: daily_study/bilibili/6_68953559.js -> daily_study/bilibili/docs/6_68953559.js
renamed: daily_study/bilibili/all_api.json -> daily_study/bilibili/docs/all_api.json renamed: daily_study/bilibili/app_0335c159.js -> daily_study/bilibili/docs/app_0335c159.js renamed: daily_study/bilibili/bakbakbakbakbakbak.py -> daily_study/bilibili/docs/bakbakbakbakbakbak.py renamed: daily_study/bilibili/header.js -> daily_study/bilibili/docs/header.js renamed: daily_study/bilibili/process -> daily_study/bilibili/docs/process new file: daily_study/bilibili/docs/regtime.py renamed: daily_study/bilibili/useful_api.json -> daily_study/bilibili/docs/useful_api.json modified: daily_study/bilibili/video_analyse.py new file: imooc.com/.vscode/launch.json new file: imooc.com/10-1.py new file: imooc.com/10-2.py new file: imooc.com/10-3.py new file: imooc.com/10-4.py new file: imooc.com/3-1.py new file: imooc.com/3-2.py new file: imooc.com/3-3.py new file: imooc.com/3-4.py new file: imooc.com/3-5.py new file: imooc.com/3-6.py new file: imooc.com/3-7.py new file: imooc.com/3-8.py new file: imooc.com/3-9.py new file: imooc.com/4-1.py new file: imooc.com/4-2.py new file: imooc.com/4-3.py new file: imooc.com/4-4.py new file: imooc.com/4-5.py new file: imooc.com/4-6.py new file: imooc.com/4-7.py new file: imooc.com/4-8.py new file: imooc.com/4-9.py new file: imooc.com/5-1.py new file: imooc.com/5-2.py new file: imooc.com/5-3.py new file: imooc.com/5-4.py new file: imooc.com/5-5.py new file: imooc.com/5-6.py new file: imooc.com/5-7.py new file: imooc.com/5-8.py new file: imooc.com/6-1.py new file: imooc.com/6-10.py new file: imooc.com/6-2.py new file: imooc.com/6-3.py new file: imooc.com/6-4.py new file: imooc.com/6-5.py new file: imooc.com/6-6.py new file: imooc.com/6-7.py new file: imooc.com/6-8.py new file: imooc.com/6-9.py new file: imooc.com/7-2.py new file: imooc.com/7-3.py new file: imooc.com/7-4.py new file: imooc.com/7-5.py new file: imooc.com/7-6.py new file: imooc.com/7-7.py new file: imooc.com/8-1.py new file: imooc.com/8-2.py new file: imooc.com/8-3.py new file: imooc.com/9-1.py new file: imooc.com/9-2.py new file: imooc.com/9-3.py new file: imooc.com/9-4.py new file: imooc.com/9-5.py new file: imooc.com/9-6.py new file: imooc.com/9-7.py new file: imooc.com/9-8.py new file: imooc.com/9-9.py new file: imooc.com/mk_filename.py new file: imooc.com/template.py new file: imooc.com/test.py
1 parent 16e706c commit 166663e

71 files changed

Lines changed: 1167 additions & 6 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
#!coding: utf-8
3+
4+
import pymysql
5+
import time
6+
import multiprocessing
7+
8+
def get_mid(u_sql, p_sql):
9+
conn = pymysql.connect(host='localhost', port=3306, user=u_sql, password=p_sql, db='bilibili', charset="utf8")
10+
cur = conn.cursor()
11+
s = 'select mid from up_info order by mid;'
12+
cur.execute(s)
13+
select = cur.fetchall()[0][0]
14+
print (select)
15+
16+
17+
def form_date(u_sql, p_sql, mid):
18+
conn = pymysql.connect(host='localhost', port=3306, user=u_sql, password=p_sql, db='bilibili', charset="utf8")
19+
cur = conn.cursor()
20+
select = 'select regtime from up_info where mid = %d;'
21+
cur.execute(select % mid)
22+
for i in cur.fetchall():
23+
print (i[0])
24+
cur.close()
25+
conn.commit()
26+
conn.close()
27+
28+
#var e = new Date(1e3 * t)
29+
#return e.getFullYear() + "-" + (e.getMonth() + 1) + "-" + e.getDate()
30+
31+
if __name__ == '__main__':
32+
config = {
33+
'host':'127.0.0.1',
34+
'port':3306,#MySQL默认端口
35+
'user':'pylocal',#mysql默认用户名
36+
'password':'123456',
37+
'db':'bilibili',#数据库
38+
'charset':'utf8',
39+
'cursorclass':pymysql.cursors.DictCursor,
40+
}
41+
u_sql = 'pylocal'
42+
p_sql = '123456'
43+
get_mid(u_sql, p_sql)

‎daily_study/bilibili/video_analyse.py‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,27 @@
33
import pymysql
44
import requests
55

6-
def dba_init(u_sql, p_sql):
7-
conn = pymysql.connect(host='localhost',port=3306,user=u_sql,password=p_sql, charset="utf8")
8-
conn.query('create database if not exists bilibili')
9-
conn.query('use bilibili')
6+
def db_init(u_sql, p_sql):
7+
conn = pymysql.connect(host='localhost', port=3306, user=u_sql, password=p_sql, db='bilibili', charset="utf8")
108
conn.query('create table if not exists up_to_av (aid int NOT NULL PRIMARY KEY, mid int NOT NULL);')
119
conn.query('create table if not exists av_info (aid int NOT NULL PRIMARY KEY, view int, danmaku int, favorite int, coin int, share int, history_rank int, CONSTRAINT MID_NOT UNIQUE (aid, mid));')
1210
#history_rank = his_rank,历史最高全站日排行
1311
conn.close()
1412

13+
def get_page_num(url):
14+
html = requests.get(url).json()
15+
print (html)
16+
17+
18+
if __name__ == '__main__':
19+
u_sql = 'pylocal'
20+
p_sql = '123456'
21+
UPID = 42697
22+
# db_init(u_sql, p_sql)
23+
url = ('https://space.bilibili.com/42697')
24+
url1 = 'https://api.bilibili.com/x/space/navnum?mid=883968&jsonp=jsonp'
25+
get_page_num(url1)
26+
27+
28+
1529

16-
def db_init(u_sql, p_sql):
17-
pass

‎imooc.com/.vscode/launch.json‎

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python",
9+
"type": "python",
10+
"request": "launch",
11+
"stopOnEntry": true,
12+
"pythonPath": "${config:python.pythonPath}",
13+
"program": "${file}",
14+
"cwd": "${workspaceFolder}",
15+
"env": {},
16+
"envFile": "${workspaceFolder}/.env",
17+
"debugOptions": [
18+
"RedirectOutput"
19+
]
20+
},
21+
{
22+
"name": "Python: Attach",
23+
"type": "python",
24+
"request": "attach",
25+
"localRoot": "${workspaceFolder}",
26+
"remoteRoot": "${workspaceFolder}",
27+
"port": 3000,
28+
"secret": "my_secret",
29+
"host": "localhost"
30+
},
31+
{
32+
"name": "Python: Terminal (integrated)",
33+
"type": "python",
34+
"request": "launch",
35+
"stopOnEntry": true,
36+
"pythonPath": "${config:python.pythonPath}",
37+
"program": "${file}",
38+
"cwd": "",
39+
"console": "integratedTerminal",
40+
"env": {},
41+
"envFile": "${workspaceFolder}/.env",
42+
"debugOptions": []
43+
},
44+
{
45+
"name": "Python: Terminal (external)",
46+
"type": "python",
47+
"request": "launch",
48+
"stopOnEntry": true,
49+
"pythonPath": "${config:python.pythonPath}",
50+
"program": "${file}",
51+
"cwd": "",
52+
"console": "externalTerminal",
53+
"env": {},
54+
"envFile": "${workspaceFolder}/.env",
55+
"debugOptions": []
56+
},
57+
{
58+
"name": "Python: Django",
59+
"type": "python",
60+
"request": "launch",
61+
"stopOnEntry": true,
62+
"pythonPath": "${config:python.pythonPath}",
63+
"program": "${workspaceFolder}/manage.py",
64+
"cwd": "${workspaceFolder}",
65+
"args": [
66+
"runserver",
67+
"--noreload",
68+
"--nothreading"
69+
],
70+
"env": {},
71+
"envFile": "${workspaceFolder}/.env",
72+
"debugOptions": [
73+
"RedirectOutput",
74+
"DjangoDebugging"
75+
]
76+
},
77+
{
78+
"name": "Python: Flask (0.11.x or later)",
79+
"type": "python",
80+
"request": "launch",
81+
"stopOnEntry": false,
82+
"pythonPath": "${config:python.pythonPath}",
83+
"program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter",
84+
"cwd": "${workspaceFolder}",
85+
"env": {
86+
"FLASK_APP": "${workspaceFolder}/quickstart/app.py"
87+
},
88+
"args": [
89+
"run",
90+
"--no-debugger",
91+
"--no-reload"
92+
],
93+
"envFile": "${workspaceFolder}/.env",
94+
"debugOptions": [
95+
"RedirectOutput"
96+
]
97+
},
98+
{
99+
"name": "Python: Flask (0.10.x or earlier)",
100+
"type": "python",
101+
"request": "launch",
102+
"stopOnEntry": false,
103+
"pythonPath": "${config:python.pythonPath}",
104+
"program": "${workspaceFolder}/run.py",
105+
"cwd": "${workspaceFolder}",
106+
"args": [],
107+
"env": {},
108+
"envFile": "${workspaceFolder}/.env",
109+
"debugOptions": [
110+
"RedirectOutput"
111+
]
112+
},
113+
{
114+
"name": "Python: PySpark",
115+
"type": "python",
116+
"request": "launch",
117+
"stopOnEntry": true,
118+
"osx": {
119+
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit"
120+
},
121+
"windows": {
122+
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd"
123+
},
124+
"linux": {
125+
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit"
126+
},
127+
"program": "${file}",
128+
"cwd": "${workspaceFolder}",
129+
"env": {},
130+
"envFile": "${workspaceFolder}/.env",
131+
"debugOptions": [
132+
"RedirectOutput"
133+
]
134+
},
135+
{
136+
"name": "Python: Module",
137+
"type": "python",
138+
"request": "launch",
139+
"stopOnEntry": true,
140+
"pythonPath": "${config:python.pythonPath}",
141+
"module": "module.name",
142+
"cwd": "${workspaceFolder}",
143+
"env": {},
144+
"envFile": "${workspaceFolder}/.env",
145+
"debugOptions": [
146+
"RedirectOutput"
147+
]
148+
},
149+
{
150+
"name": "Python: Pyramid",
151+
"type": "python",
152+
"request": "launch",
153+
"stopOnEntry": true,
154+
"pythonPath": "${config:python.pythonPath}",
155+
"cwd": "${workspaceFolder}",
156+
"env": {},
157+
"envFile": "${workspaceFolder}/.env",
158+
"args": [
159+
"${workspaceFolder}/development.ini"
160+
],
161+
"debugOptions": [
162+
"RedirectOutput",
163+
"Pyramid"
164+
]
165+
},
166+
{
167+
"name": "Python: Watson",
168+
"type": "python",
169+
"request": "launch",
170+
"stopOnEntry": true,
171+
"pythonPath": "${config:python.pythonPath}",
172+
"program": "${workspaceFolder}/console.py",
173+
"cwd": "${workspaceFolder}",
174+
"args": [
175+
"dev",
176+
"runserver",
177+
"--noreload=True"
178+
],
179+
"env": {},
180+
"envFile": "${workspaceFolder}/.env",
181+
"debugOptions": [
182+
"RedirectOutput"
183+
]
184+
}
185+
]
186+
}

0 commit comments

Comments
 (0)