Detect Visitors From Twitter

Detect Visitors From Twitter

Much like some websites detect visitors from search engines and greet them in a unique way, Twitter visitors can be automatically detected as well. This is done in almost the exact same manner as search engine detections, using conditional PHP code to check for a visitor’s referral agent and greet them accordingly. here’s how it looks:

< ?php if (strpos(“twitter.com”,$_SERVER[HTTP_REFERER])==0) { echo “Hey, Twitter enthusiast! We’re glad you’re here. If you like what you see, be sure to Tweet about it and follow our account!”; } ?>

This code can be placed wherever the greeting should be displayed. Because it is entirely self-contained, there are no modifications necessary to the “functions.php” file or any other files on the FTP server. Only the template files need to be altered.

Citar referência no trabalho acadêmico:

SWAMI, Jario. Detect Visitors From Twitter, Java Blog; (2016); Disponível em: https://java.jar.io/detect-visitors-from-twitter. Acesso 7/08/2016.