Open leofcshen opened 1 month ago
Let me check.
我也想測試 https://pyptt.cc/docker.html 下列的用法,但程式庫裡查不到 object_encode 的方法。
import PyPtt
import requests
from src.utils import object_encode
from tests import config
if __name__ == '__main__':
params = {
"api": "login",
"args": object_encode({
'ptt_id': config.PTT_ID,
'ptt_pw': config.PTT_PW
})
}
r = requests.get("http://localhost:8787/api", params=params)
print(r.json())
params = {
"api": "get_time",
}
r = requests.get("http://localhost:8787/api", params=params)
print(r.json())
params = {
"api": "get_newest_index",
"args": object_encode({
'board': 'Gossiping',
'index_type': PyPtt.NewIndex.BOARD
})
}
r = requests.get("http://localhost:8787/api", params=params)
print(r.json())
##############################
content = """此內容由 PyPtt image 執行 PO 文
測試換行 123
測試換行 456
測試換行 789
"""
params = {
"api": "post",
"args": object_encode({
'board': 'Test',
'title_index': 1,
'title': 'test',
'content': content,
})
}
r = requests.get("http://localhost:8787/api", params=params)
print(r.json())
##############################
params = {
"api": "logout",
}
r = requests.get("http://localhost:8787/api", params=params)
print(r.json())
請問有進一步的資訊嗎
Hi @leofcshen,
最近比較忙碌一些。 我預計週末可以給進一步的更新。
CodingMan
請問 search_list 參數要怎麼給值才對