I am trying to figure out how to let my users post a tweet by following a link on my site. This is the process I design:
A link somewhere on my site will have an offer: "Send a Twit and receive a coupon". Once they click on the offer link, they are redirected to Twitter for authorization. After they grant a permission to connect with their Twitter profile, I would like to send a post using Twitter API, with a pre-populated message, something like: "Trying out this online tool for free: http"//mylink.com". After the message is posted they need to be redirected back to my site to a page with a coupon code.
I got about 75% done so far.
I installed twitterOauth library(Abraham's) Based on demo examples I can now do the following: -- Link to Twitter (DEMO) -- Login the user with Twitter -- Redirect back to my site
What I still need to figure out is how to post the Tweet… Ideally I would like to show the message that will be posted, but without a functionality to edit it, just to let them know. I can possibly show it on the first page, which means I’d like to post it automatically once they grant permission to Twitter, right before redirecting to the coupon code. Where do I add POST functionality?