首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >有没有可能直接从电报聊天中发布到telegra.ph?

有没有可能直接从电报聊天中发布到telegra.ph?
EN

Stack Overflow用户
提问于 2017-08-30 18:32:27
回答 2查看 3.6K关注 0票数 1

除了有一个云信使平台,Telegram还有一个叫做telegra.ph的博客网站。它在功能上可与Medium或WordPress相媲美,并使用电报帐户作为发布的帐户。可以通过聊天机器人账号@telegraph登录到这个账号,但据我所知,帖子的实际创建和编辑只能在web浏览器中完成。

可以直接从聊天界面发布到telegra.ph吗?我不知道该怎么做,但也许我看起来不够好。

谢谢!

EN

回答 2

Stack Overflow用户

发布于 2017-08-31 11:43:45

您可以使用该接口来执行您要求http://telegra.ph/api执行的操作

票数 0
EN

Stack Overflow用户

发布于 2019-05-13 01:06:36

聊天可以使用api.telegra.ph或traph.io/api直接发送到telegra.ph或traph.io/api。如果您愿意,我可以为您提供我创建的API,使您可以更轻松地使用python编程语言完成此操作。

代码语言:javascript
复制
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())
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45958082

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档