0

I have a button that will be disabled until you send out a tweet that I have crafted.

Only users with twitter accounts will have access to this, and I will require users to sign-in to be able to access this button.

What kind of tools are available for me to check whether

  1. The user has actually tweeted it
  2. The user has not deleted the tweet afterwards

Now, there is no way to actually stop the user from deleting the tweet, but I would like to disable the button if the user has actually chosen to delete it afterwards.

1

By the fact "Only users with twitter accounts will have access to this, and I will require users to sign-in to be able to access this button" it simply means that the user ALREADY has login, before you start creating the HTML page.

Ie, before login, the user will see a form of HTML page, but after login, and at your webserver you have authenticated him via OAUTH2, then you will create the HTML specifically past-login.

That will also help to answer "the user has actually tweeted it", as you can now link the userid, with the tweet counter for specifically that user - 0 or 1. Ie, you need will need to maintain a database at the server side of all userid who have tweeted it, and then add/remove everytime a new user added to it, or old user remove from it. (which answer question 2)

Now, finally is the display of button: simple, just check the database, if the userid is there, display it, otherwise don't generate the button for the HTML.

As you can see, everything is done at the server side - just like the user-dependent information for stackexchange.com as well. If u create embedded Javascript to do the generation of HTML? well, it is not secure, and also wrong, because the user can login / delete from from two different PC/browser, and you will get inconsistencies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.