Sorry, that page doesn’t exist w/ Web Intents


#1

Link to Stackoverflow question:

Per the Twitter Web Intents documentation, I figure that I should be able to create the following links, and have them properly open a Web Intents window to twitter. The Web Intents window opens properly, however I get the error “Sorry, that page doesn’t exist”. Here is what I have done.

I added the following script tag to my Angular template:

Then, I have an ng-repeat for each tweet, which contains the following code:

Reply

Retweet

Favorite

For each tweet that is on the page, the proper HTML is generated. In the case that the tweet has the id 431111460186759200, the following html is generated for these links:

Reply

Retweet

Favorite

When I click on these links, the proper modal is opened, in the recommended size (thanks to the widget.js file I embedded), with the correct URL. However, instead of showing the Web Intent screen, it shows me a screening saying “Sorry, that page doesn’t exist. Thanks for noticing—we’re going to fix it up and have things back to normal soon.”

Any thoughts?


#2

I already replied on Stack Overflow, but also leaving a copy of my answer here.
It’s simply because there is no tweet with id 431111460186759200. If you try with the id 431216327143858177 it works fine: https://twitter.com/intent/tweet?in_reply_to=431216327143858177.

If the tweet your code is referencing still exists, try using tweet.id_str instead of tweet.id. For example Javascript can’t handle numbers as big as tweet ids so for example 431216327143858177 becomes 431216327143858200. Using id_str you would be sure it works in any language.

And by the way it’s better to use https links rather than http ones.


#3

I totally agree with your answer. It appears that my Java service that fetches the tweets for me us doing something weird to the tweet ids, rounding all of them up significantly. So, I will work with my service fellows to fix this.

Thanks for the clues here.


#4

Note that JavaScript integers at limited to 53-bit length, whereas Tweet IDs are 64-bit. You need to treat IDs as strings in JavaScript (if you’re passing API objects down directly, use the id_str field, otherwise, make sure you’re quoting the ID in your responses.)


#5