PSR
PSR

Reputation: 40338

What is data-widget-id in twitter api ? How i can get the data-widget-id?

I have some problems with previous version of the twitter api and I want to move to latest version. I see some information here https://dev.twitter.com/docs/embedded-timelines.

What is data-widget-id here. I want to show some specified people tweets in my website.

How do I do that?

Upvotes: 10

Views: 38023

Answers (2)

gabriel
gabriel

Reputation: 379

Found the solution.

You can override the data-widget-id parameter in the widget by additionally setting the data-screen-name parameter inside the a tag of the widget. Like this:

<a class="twitter-timeline" href="https://twitter.com/<%= escape_javascript(@site.twitter_username) %>" data-widget-id="363460440807833600" data-screen-name="garzagabriel"></a>

NOTE: You still need to include the data-widget-id parameter. So generate the widget first by going to https://twitter.com/settings/widgets, and then add the data-screen-name parameter to the a tag in the embed code (like shown above)

Here is the documentation for this: https://dev.twitter.com/docs/embedded-timelines#timeline-selection

Best!

Upvotes: 11

ottel142
ottel142

Reputation: 2016

Your question is already answered on the Twitter Developers page.

To create a timeline you must be signed in to twitter.com and visit the widgets section of your settings page. From this page you can see a list of the timelines you've configured and create new timelines.

  1. Sign in on twitter.com
  2. Create a new widget
  3. The widget-id is provided by Twitter (you will be redirected to https://twitter.com/settings/widgets/xxxxxxxxxxxxxxxxxxx/ - the xxx is your widget-id)

Upvotes: 15

Related Questions