The new twitter API 1.1 says that the used method to retrieve the tweets is deprecated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lokapujya’s picture

Furthermore, the new twitter widgets (called Twitter Timelines) seem to use an iFrame so you can't apply CSS to the iFrame. Plus, they don't seem to be as configurable as the old widgets. So is the solution to use the API?

slamorte’s picture

Seriously, not a single person has a fix or comment for this? Isn't this a core feature of this module?

I've hacked at this as best as I can but I have no idea how to get Twitter's new code working with the Social Media module.

slamorte’s picture

UPDATE: Here's a work-around.

Go to https://twitter.com/settings/widgets. Make yourself a Twitter widget, customizing the settings you want here.

Copy the embed code from your widget page.

Create a new block.

Paste the embed code into the block. Make sure you've got a WYSIWYG text format that can accept unrestricted code.

Save your block, place it in a region. That's it, you'll have your twitter feed wherever your block is placed.

mdixoncm’s picture

I've put together the beginnings of a small patch to allow the twitter-profile widget to work again ... needs some further testing ...

nlambert’s picture

The twitter timeline widget is now authenticated:

https://dev.twitter.com/discussions/18458

i.e.: you must create it from your account (read: it must exist in your account):

http://twitter.com/settings/widgets

Not sure where to begin :

Should the twitter profil have a "paste box" for that info? admin/config/media/socialmedia/profiles

OR

Should the twitter widget have that info? admin/structure/widgets/sets/edit/twitter-profile-widget

I'm not familiar with the widget api.

fenstrat’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
2.95 KB

Attached is a reroll of #4 with the addition of a description that outlines the need to create and configure the widget at https://twitter.com/settings/widgets

Like @nlambert I am unfamiliar with the widgets module so am not sure if this is the best place to override. admin/config/media/socialmedia/profiles relates to all profile settings how however this is a widget specific setting and so the patch goes with the idea of editing the widget at admin/structure/widgets/sets/edit/twitter-profile-widget

At the very least this makes the twitter widget functional again.

dan.mantyla’s picture

For my site I need a twitter widget for each of my authors/hosts's profile page. I thought maybe a workaround was to add a field for user profiles and add the embed code, but any authenticated user would have the same field because there's no control between role to role, and obviously we don't want any user to add javascript code.

dooug’s picture

The patch from #6 worked in my case.

Also, this didn't work without the twitter widget ID entered. So, it should be clear that this patch requires the twitter profile widget to be reconfigured.

The twitter widget id token defaults to 0, but in my case this didn't work and the widget id was required. Why does it have a default if the widget id is required? Or am I mistaken?
settings:twitter_widget_id=0

davidneedham’s picture

Version: 7.x-1.0-beta13 » 7.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

The patch in #6 works for me and applies cleanly against dev.

davidneedham’s picture

Status: Reviewed & tested by the community » Needs work

This patch is SO close. It works great for the site-wide Twitter feed. But if you view the feed on a user profile, it flashes "Tweets by " [my personal twitter handler], but then it updates to show tweets by the website instead.

The personal feed will require each person to enter the widget ID just as the site-wide form does. Perhaps it could be optional so that they could leave out the widget ID to benefit from their personal twitter link without the feed?

enap’s picture

I applied the patch from #6 however I'm still getting the deprecated API error, am I missing something?

seanr’s picture

I'm very confused - I applied the patch from #6, but I don't see anywhere to put the twitter widget ID. Neither path mentioned in #6 contains that field even though I have confirmed this code is in my patched module:

function socialmedia_widgets_element_alter_twitter_profile_widget(&$form, $set, $element) {
  $form['settings']['twitter_widget_id']['#description'] .= ' ' . t('Twitter widget must be created and configured at <a href="!link">https://twitter.com/settings/widgets</a>, paste generated id here.', array('!link' => 'https://twitter.com/settings/widgets'));
  $form['settings']['#weight'] = -1;

}

WTF? ;-)

davidneedham’s picture

@seanr

You have to edit the default Twitter widget (Structure > Widgets).

seanr’s picture

I'm on what I think is the right page, but I don't see any field for that. See here.

davidneedham’s picture

@seanr from that page you must click the override defaults button at the bottom, and then edit the twitter profile widget.

TomDude48’s picture

Status: Needs work » Needs review

I have done a lot of updates to this module as a part of client work. The new Twitter API is one of those fixes. I went ahead and pushed the latest version so you would have the fix.

I have not gotten a lot of time to test the module outside of Open Enterprise, so I just pushed it to 7.x-1.x-dev branch. If we can get some testing in, I will create a new release.

seanr’s picture

Status: Needs review » Needs work

Aha. That worked. Thanks. This definitely needs better documentation, though. ;-)

rudyard55’s picture

@TomDude48 I apologize, but I'm not tracking on what I'm supposed to populate the field labeled "Twitter user timeline widget id " with in the dev version. Where do I find the id?

TomDude48’s picture

I haven't looked at that in Twitter in a while. I think the interface has changed so it is not as straight forward figuring out what your id is.

But if you setup a widget in Twitter and look at the embed code. It is the value for the data-widget-id attribute. For example in this embed code the id would be 123456789:

<a class="twitter-timeline" href="https://twitter.com/levelten_tom" data-widget-id="123456789">Tweets by @levelten_tom</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>