Reputation: 519
Currently we have a page on a client website that is too large for twitter to crawl on share (>1mb). I want to figure out a way to detect that twitter is crawling the page, and instead serve a limited version of the page.
The website is built in in apache and expressionengine, and so I can use template parsing based on url structure to limit content if necessary.
I also have access to the linux server itself (ssh) if necessary.
So far I am trying to come up with a way to have twitter crawl the url with a query string or something that i can have expression engine listen for.
Upvotes: 1
Views: 46
Reputation: 499
I guess the alternative would be to enable php in the template and sniff for the user agent that way. However, i think doing this with a plugin would really work better and won't bloat load times at all. For more indepth answers, post this question on https://expressionengine.stackexchange.com/
Upvotes: 1
Reputation: 519
There are some expression engine addons that allow you to sniff user agents to use as template variables. you can then conditionally display content on whether that user agent is 'Twitterbot'
Example: https://devot-ee.com/add-ons/browser-detect
Upvotes: 1