1. Embed Twitter In Your Website

    Recently Twitter has become the main outlet for Social Media on the Web, so it’s only logical that people want to embed twitter on their personal websites.

    But what if you are one of those people who doesn’t want a nasty Widget on their site? Well here is the solution to embed twitter fast - 1 line of PHP:

    <?php             

    echo simplexml_load_file(“http://twitter.com/statuses/user_timeline/yourusername.xml?count=1”)->status->text;                       

    ?> 

    It’s really that easy! Simply substitute your username into the PHP to embed twitter into your website!

    There are three small points to make though.

    1. If you have your Twitter feed set to private, you won’t be able to embed twitter.
    2. You will have to change your webpage to .php instead of .html. … OR
    3. You need to have a ‘.htaccess’ file in your root folder (where you store your website). Otherwise rename your file with .php at the end instead of .html.

    Check out this post on how to create a ‘.htaccess’ file if you don’t already know.

    Thanks to @mikevanis and @hellopablo for help on how to embed twitter.

    And that is how you embed twitter on your website.

    Happy Tweeting!

    Finlay

    ps…Use this on your site? Leave a comment below and tell me how you got on!

Notes

  1. finlay posted this