FreeLeek Home:FreeLeek
Project Repository: https://gitee.com/qian_zehao/free-leek
Before developing and deploying this program, a lot configuration is required which are some account settings and environment configuration. If you didn't follow the instructions below, the program will not work properly. And if you have trouble, welcome contacting me through email: qianzehao123@gmail.com
wx_interface:
appid: "<server appid>"
secret: "<server secret>"
openid: "<user wechat id>"
template_id: "<user template_id>"
tushare_tocken: "<Your tushare token>"
time_interval: <set wx_msg_send interval>
WeChat Open Platform: https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index
Step 1: Get appid and secret
Step 2: Scan QR Code and get openid
Step 3: Edit message_template.json file in both WeChat platform and this code document, after create test template, you will see the API as below.
template_title: # FreeLeek
template_content:👇👇👇
FreeLeek 财经新闻
{{title0.DATA}}
{{content0.DATA}}
{{title1.DATA}}
{{content1.DATA}}
-- By 自由韭菜基金会
We get financial data from Tushare, before using you need to create an tushare pro account and duplicate token to the config.yaml file
Tushare Register Port: https://tushare.pro/register?reg=559374
Tushare ProToken: https://tushare.pro/user/token
You can also set the interval of this application executing by editing the config.yaml file and the time unit is second.
In order to keep your OS environment clean, we strongly recommend that you can use miniconda to create Python virtual environment.
# Create a conda env named freeleek
$ conda create -n freeleek python=3.9
# activate freeleek with conda
$ conda activate freeleek
# install pip dependencies
$ pip install -r requirements.txt
# make sure conda env is freeleek
# cd /path/to/freeleek root directory
# set flask environment variables
$ export FLASK_DEBUG=True
$ export FLASK_APP=src
# Run!
$ flask run
# make sure conda env is freeleek
# cd /path/to/freeleek root directory
# set flask environment variables
$ set FLASK_DEBUG=True
$ set FLASK_APP=src
# Run!
$ flask run
If you want to deploy this project on your own server, VPS or even some ARM single board like RaspberryPi and Orange Pi, you have to install docker env in your computer. This may be the fastest method to install docker below.
$ export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"
# if you use curl
$ curl -fsSL https://get.docker.com/ | sh
# or wget
$ wget -O- https://get.docker.com/ | sh
Before deployment, you must make sure things as follows:
version: '3'
services:
<backend_server_name>:
container_name: freeleek_<name>
build: .
ports:
- "<Any empty port>:5000"
restart: always
After that, you can run it with your server by this command:
# build docker images
$ sudo docker-compose build
# start docker stack
$ sudo docker-compose up -d
And if you want to stop it by these commands:
# stop docker stack
sudo docker-compose down
# delete docker containers and images
$ sudo docker container prune
$ sudo docker image prune -a
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。