duanjia6959 2018-12-05 21:22
浏览 43

PHP,OAUTH和发布到Twitter

I'm developing a mobile website for work that involves posting to Twitter. I needed a simple starting point to build upon and came across a website which had the perfect PHP code for working with. Trouble is, I can't get it to work.

Here is where I found the code: DiscussDesk - PHP Code to Post to Twitter

Here is a Demo of it working on their site: Demo of PHP Posting to Twitter

My knowledge of PHP is fairly rudimentary, and my knowledge of OAUTH is nil-to-none, however the implementation seems fairly straight forward. I can understand PHP fairly well.

I can't seem to get this code working however. I have set up the app in Twitter, added the access keys to the config file, and have been confused with the callback url. I have loaded the code to my own website at: http://twitter.chris-alexander.com so my first question it - would this URL I've loaded it to be the callback url? Would it be for both the Twitter App Dashboard and the php config file? I've seen other examples show something like: http://twitter.chris-alexander?source=twitter for one of them.

I've tried multiple iterations of the call back url like above, but maybe I'm missing something? The demo site that is above makes a call to Twitter and grabs the access tokens. You can see that the code works, but it seems I'm doing something wrong.

For convenience I have added the code to a repository at https://github.com/cmalexander/php-post-to-twitter/tree/master

Any help would be greatly appreciated!

Chris

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器