Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The module correctly picks up all the data from a tweet minus the image or image card.
With instagram and facebook import the images correctly.
Comment | File | Size | Author |
---|---|---|---|
#7 | social_content-extended_tweets-2845235-7.patch | 2.17 KB | tostinni |
Comments
Comment #2
arezeeman CreditAttribution: arezeeman commentedI returned to some code today that working fine last fall but now doesn't seem to get the images from a tweet--seems likely to be the same problem. I think it's a change in the Twitter API, not an issue with Social Content. See this:
https://dev.twitter.com/overview/api/upcoming-changes-to-tweets
Here's what I've learned (keep in mind thay I know virtually nothing about the twitter API beyond what I needed to get my code working):
First step to get things working is to add the "tweet_mode=extended" flag, which can be done with a patch to social_content_twitter.class.inc:
Next thing is deal with the 'full_text' vs. 'text' issue and the retweeted media. Instead of patching, I made a subclass of SocialContentTwitter, though hopefully these changes can be rolled into the module code.
Need this hook to point to the override class:
Finally, need to add a line to the module .info file and rebuild the class registry.
Many thanks for Social Content--very nice, flexible design.
Comment #3
troesler CreditAttribution: troesler commentedThanks arezeeman,
Where do you add the hook
Comment #4
arezeeman CreditAttribution: arezeeman commentedI put it in a custom module that I use for site-specific code that I don't want to put in the theme. You could also put it into your theme's template.php file. You might be able to load the subclass in your theme, too--I don't see why not, but I've never tried it. Or you could make a little custom module--let's call it lcm.
File lcm.info:
File lcm.module:
File lcm.social_content_class_override.inc:
Once the files are in place, in the directory sites/all/modules/custom/lcm, you'd have to enable the module. That's the code I've added to my custom module, but I haven't tested that it as a little stand-alone module, so it's possible I've missed something.
Comment #5
troesler CreditAttribution: troesler commentedThank you again, especially for your chrystal clear explaination ;)
It works like a charm !
Comment #6
Melju CreditAttribution: Melju commentedI still have the issue. When I'm enabling your module ans when I go to the configuration page of Social Content it display a white page.
What am I doing wrong?
Thanks
Comment #7
tostinni CreditAttribution: tostinni at Agence Propal commentedI prepared a patch based on this code, thank you arezeeman.
Comment #9
Pere OrgaMerged to dev, thanks!