Allow users of my profile based site to embed their twitter feeds without allowing <script> tags?


Im making a website where users create profiles. I want users to be able to embed their twitter feeds on their profile page for others to see.

Im using a CMS but I want the posts to be pulled on the front end. I dont want the posts to be content thats imported into the CMS. I also need it to be easy for users to set up their feeds, ideally by just entering their usernames into the CMS.

With facebook its easy to achieve this with the likebox (users can embed pages not personal profiles). The likebox uses the code below, and my CMS swaps out FACEBOOK-NAME for the user’s page’s facebook name.

However I havnt been able to do the same thing with twitter. Here USERNAME is only used to create the link back to twitter. Im assuming the number 400306334253318144 is the user’s ID of some sort, but you also have to enable the widget within

Tweets by @USERNAME

Is there any solution that will allow users to embed their twitter feed by just providing their username or twitter url?

If they do need to enable the widget in then thats not the end of the world. But is there a simpler way of then embedding a feed? I dont want to allow tags for user provided content in my CMS for security reasons.


The user timeline embedded timeline allows you to create one “widget instance” (the widget identified by data-widget-id that you get when you create your widget with the widget configurator) and then re-use that instance for X number of profiles. So the data-widget-id never changes but the USERNAME does. The “Timeline Selection” section of the embedded timeline docs go into this, but the gist is that you want to add an additional parameter, data-screen-name.

Like so:

Tweets by @USERNAME


I was wondering if you could post the code your using (just for example purposes!) because im lost and need to know what i need to do to have someone embed their own timeline. I’ve looked all over the inter-webs and couldn’t find anything, so i thought i would ask here because you people have the answer!

Thanks in advance!


hi… my twitter home page is not getting pen Google chrom… pl help