How does Twitterbot handle shebang (#!) URLs on dynamic websites?


#1

I run SmugMug, a popular photo & video sharing service with over 35M visitors a month, and I just implemented Twitter Cards last night.

One question that’s not obvious from the docs is how you handle shebang (#!) URLs on dynamic sites like SmugMug (& Twitter). I’m hoping Twitterbot uses escaped_fragment notation much like other bots (see: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=174993) but it’s not clear.

As an example, we have our canonical URL for a photo in a gallery here: http://cmac.smugmug.com/SmugMug/Support-Heroes-painted-faces/2504559_TrBCmb/131487110_FdKeW

But depending on a variety of things, including your browser type & version, you probably see something more like: http://cmac.smugmug.com/SmugMug/Support-Heroes-painted-faces/2504559_TrBCmb#!i=131487110&k=FdKeW

Over time, we expect our URLs to drift to the former, rather than the latter, but today shebang URLs are easily the most common, and I want to make sure we’re serving up the right Twitter Card to Twitterbot.

Example with escaped_fragment: http://cmac.smugmug.com/SmugMug/Support-Heroes-painted-faces/2504559_TrBCmb?escaped_fragment=i%3D131487110%26k%3DFdKeW (hmm, the discussions are trimming this a little, you’ll need to manually edit slightly to re-add the first underscore to see what I’m talking about)

Thanks!


#2

So it appears that the twitter bot doesn’t use an escaped fragment. Perhaps you can help put some pressure on twitter to fix this. https://dev.twitter.com/issues/1290


#3

This issue has been resolved; the Twitterbot now supports #! by converting to “escaped_fragment.”