|
@@ -153,6 +153,26 @@ def get_news_by_kw(keyword):
|
|
|
|
|
|
def flex_test():
|
|
|
js=json.load(open('test.json','r',encoding='utf-8'))
|
|
|
+ for i in range(3):
|
|
|
+ row_dict = {}
|
|
|
+ row_dict['type'] = 'box'
|
|
|
+ row_dict['layout'] = 'baseline'
|
|
|
+ row_dict['contents']= [
|
|
|
+ {
|
|
|
+ "type": "text",
|
|
|
+ "text": "第"+str(i)+"名次",
|
|
|
+ "size": "sm",
|
|
|
+ "color": "#aaaaaa",
|
|
|
+ "flex": 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "text",
|
|
|
+ "text": "hello, world"+str(1),
|
|
|
+ "flex": 5,
|
|
|
+ "weight": "regular"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ js['body']['contents'] = js['body']['contents'] + [row_dict]
|
|
|
return js
|
|
|
|
|
|
|