Post tweet in twitter directly from my website using javascript - Stack Overflow

My website is allow user to tweet something to their timeline in twitter. When they click on tweet butt

My website is allow user to tweet something to their timeline in twitter. When they click on tweet button, twitter box platform will popup and user can write or edit something before tweet; but I don't want this way, I want is when they click on tweet button it will tweet to their timeline automatically (no need to call twitter box platform). Is it possible?

My website is allow user to tweet something to their timeline in twitter. When they click on tweet button, twitter box platform will popup and user can write or edit something before tweet; but I don't want this way, I want is when they click on tweet button it will tweet to their timeline automatically (no need to call twitter box platform). Is it possible?

Share Improve this question edited Mar 26, 2016 at 14:23 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Mar 24, 2016 at 12:59 hamedhamed 611 silver badge4 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 3

Here is the twitter's documentation : https://dev.twitter./web/javascript

Short answer: no

When using the Twitter API, anything that you want to do that involves a user's account (post tweets, retweet, favorite, etc. ) will require permission from the user. This permission is given in the form of a user's unique access key and secret.

In order to obtain a user's key & secret you will need to authenticate the user using a Twitter sign in. This process will take the user to Twitter's sign in page. Once they have successfully signed in they will be redirected back to your app.

For further reading, please see: https://developer.twitter./en/docs/accounts-and-users/subscribe-account-activity/guides/authenticating-users

const windowReference=window.location.href;
const hrefEl="https://twitter./intent/tweet?url=" + windowReference + "&text=" + encodeURIComponent(textToTweet);
tweetButton.setAttribute('href',hrefEl)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744249918a4565119.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信