-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathdiy.py
52 lines (44 loc) · 1.12 KB
/
diy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
'''
Author: Thund1r thund1r@foxmail.com
Date: 2022-09-22 14:18:12
LastEditTime: 2022-09-29 09:34:31
Description: 自定义数据
Copyright (c) 2022 by Thund1r thund1r@foxmail.com, All Rights Reserved.
'''
# -*- coding: utf8 -*-
import config
import days
import api
import requests
import random
title = config.get("title")
content = config.get("content")
pic = config.get("pic")
# 获取标题数据
def get_my_title():
my_title = title
if my_title:
return my_title
else:
# 需要通过接口获取动态内容时,请替换下一行内容
return None
# 获取自定义第一段内容数据
def get_my_content():
content_list = []
today_tip = days.get_today()["today_tip"]
content_list.append(today_tip)
my_content = content
if my_content:
content_list.append(my_content)
chp_tip = api.get_chp()
if chp_tip:
content_list.append(chp_tip)
# 加入其他数据作为第一段在这里接收
return '\n'.join(content_list)
# 获取自定义头图数据
def get_my_pic():
my_pic = pic
if my_pic:
return my_pic
else:
return None