Skip to content

Commit 92084cf

Browse files
committed
Final version
1 parent fc9a2d9 commit 92084cf

29 files changed

+4522
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.pyc
2+
*.class
3+
.DS_Store
4+
statistic/src/output/*
5+
statistic/src/input/*
6+
.idea

bigscreen.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
read -p "Step 1 数据下载" -n1
2+
3+
curl -L https://etherpad.opendev.org/p/PRC-OpenSource-Hackathon-11-ChangSha/export/txt -o ./statistic/input/data
4+
5+
cat ./statistic/input/data | head -10
6+
7+
read -p "Step 2 数据分析" -n1
8+
hadoop fs -put ./statistic/input/data input
9+
hadoop jar ./statistic/target/statistic-1.0-SNAPSHOT.jar org.hackathon.data.Statistic input output
10+
hadoop fs -get output ./statistic/
11+
tree ./statistic/output
12+
13+
read -p "Step 3 后端" -n1
14+
sudo apt update
15+
sudo apt install -y python3 git python3-pip
16+
pip3 install flask
17+
cd ./bigscreen
18+
python3 export.py
19+
python3 -m http.server 5000

bigscreen/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea/

bigscreen/app.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
# @Time : 2020/8/26 14:48
4+
# @Author : way
5+
# @Site :
6+
# @Describe:
7+
8+
from flask import Flask, render_template
9+
from data import SourceData
10+
11+
app = Flask(__name__)
12+
13+
14+
@app.route('/')
15+
def index():
16+
data = SourceData()
17+
with open('./static/hackathon.html', 'w') as f:
18+
f.write(render_template('index.html', form=data, title=data.title))
19+
return render_template('index.html', form=data, title=data.title)
20+
21+
22+
if __name__ == "__main__":
23+
app.run(host='127.0.0.1', debug=False)

0 commit comments

Comments
 (0)