Search code examples
twittergoogle-chrome-extension

Hackathon project regarding Twitter


I will be attending my first hackathon this upcoming weekend, and plan to create a Twitter-based Chrome extension. Basically, when someone wants to tweet or reply to something, and they click the 'tweet' button, it will open up a pop-up modal that asks them some questions about their tweet (so as to encourage them to be mindful about what they post). Within the modal, there will be a button that then publishes the tweet.

So, to sum it up, my modal will be an intermediary in the process of posting a tweet.

What technologies will be useful in implementing this? Specifically, how can I implement the feature in which someone clicks the tweet/reply button, and it opens up my web app's modal on the same screen? Correct me if I am wrong, but I think this is called event capture? Does this have anything to do with Web Intents?

Thanks!


Solution

  • I have done similar things on other sites. A high level overview of what you should try doing:

    • Find out how twitter sends tweets, the "tweet" button has a "js-send-tweets" class, I would start by investigating that. They probably have a piece of js listening to the button press.
    • Once you figured it out you can override that function by injecting your own script to the page after twitter's. This way when you press tweet your function will execute.
    • You should write your own logic in there then add twitter's function logic too which would conditionally execute based on the user's action.