除了有一个云信使平台,Telegram还有一个叫做telegra.ph的博客网站。它在功能上可与Medium或WordPress相媲美,并使用电报帐户作为发布的帐户。可以通过聊天机器人账号@telegraph登录到这个账号,但据我所知,帖子的实际创建和编辑只能在web浏览器中完成。
可以直接从聊天界面发布到telegra.ph吗?我不知道该怎么做,但也许我看起来不够好。
谢谢!
发布于 2017-08-31 11:43:45
您可以使用该接口来执行您要求http://telegra.ph/api执行的操作
发布于 2019-05-13 01:06:36
聊天可以使用api.telegra.ph或traph.io/api直接发送到telegra.ph或traph.io/api。如果您愿意,我可以为您提供我创建的API,使您可以更轻松地使用python编程语言完成此操作。
import json
MAIN_URL = 'https://api.telegra.ph/'
class apiuz():
def __init__(self):
self.http = requests.Session()
def callMethod(self, n_method=None, a_method=None):
xitoy2= MAIN_URL + n_method.__name__+'?'
for x,y in a_method:
if x!='self' and y!=None: xitoy2+=x+'='+str(y)+'&'
response = self.http.get(xitoy2[:-1])
xitoy2 = eval(response.text.replace('\/','/').replace('true','True').replace('false','False'))
return xitoy2
#Methods created by @apiuz
def createAccount(self, short_name=None, author_name=None, author_url=None):
return self.callMethod(n_method=self.createAccount, a_method=locals().items())
def editAccountInfo(self, access_token=None, short_name=None, author_name=None, author_url=None):
return self.callMethod(n_method=self.editAccountInfo, a_method=locals().items())
def getAccountInfo(self, access_token=None, field=None):
return self.callMethod(n_method=self.getAccountInfo, a_method=locals().items())
def revokeAccessToken(self, access_token=None):
return self.callMethod(n_method=self.revokeAccessToken, a_method=locals().items())
def createPage(self, access_token=None, title=None, author_name=None, author_url=None,
content=None):
return self.callMethod(n_method=self.createPage, a_method=locals().items())
def editPage(self, access_token=None, path=None, title=None, content=None,
author_name=None, author_url=None):
return self.callMethod(n_method=self.editPage, a_method=locals().items())
def getPage(self, path=None):
return self.callMethod(n_method=self.getPage, a_method=locals().items())
def getPageList(self, access_token=None, offset=0, limit=50):
return self.callMethod(n_method=self.getPageList, a_method=locals().items())
def getViews(self, path=None, year=None, month=None, day=None, hour=None):
return self.callMethod(n_method=self.getPageList, a_method=locals().items())
https://stackoverflow.com/questions/45958082
复制相似问题