The Twitter Feed module displays a configurable list of tweets in a block. It does so using the Twitter REST API
and the jQuery Timeago plugin to display dates in a friendly, relative format (eg. 4 hours ago).
No assumptions about CSS.
Responses are cached.
No extra dependencies. Just install and go.
Output is fully themeable.
It's different from other modules (like https://www.drupal.org/project/twitter_block) because it pulls full twitter PHP objects and therefore can be used to generate any markup necessary.
With other modules that simply generate a twitter widget, it's impractical to customize the css in any way (as the end result is just an iframe) and to generate custom behavior.
Clone with:
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/Fidelix/2725795.git twitter_feed
cd twitter_feed
Project page : https://www.drupal.org/sandbox/Fidelix/2725795
You will need a Twitter API key if you want to see it running.
Comment | File | Size | Author |
---|---|---|---|
CoOpp3.png | 34.75 KB | Fidelix |
Comments
Comment #2
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxFidelix2725795git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
Fidelix CreditAttribution: Fidelix as a volunteer commentedThe messages are false positives. Stuff on the included libraries.
Comment #4
klausiThe Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on Drupal.org.
Comment #5
Fidelix CreditAttribution: Fidelix as a volunteer commented@klausi, 3rd party code removed, and some extra fixes performed.
Comment #6
flocondetoileproject page added in issue summary
Comment #7
flocondetoileHI @Fidelix.
By convention (and consistance) template must use - and not _ (twitter_feed-item.html.twig) in the file name.
I wonder too why you apply the raw filter on the text variable in this template, whereas $text is a render array (#markup) which is rendered and autoescaped by Twig (if there is not the raw filter applied to it) ? The value in the text variable are not really user input, but is the tweet's content, and so, unknown.
Comment #8
Fidelix CreditAttribution: Fidelix as a volunteer commentedHello @flocondetoile, thank you very much for the review.
I addressed the template file name.
About the tweet content, it's actually always HTML (already sanitized by twitter, as it has exactly what is displayed on the twitter page).
So I can't just pass it to Twig because twig will destroy the content of most tweets.
But you are right that using #markup is enough - #markup does not remove the twitter html tags, and already applies XSS filtering as per https://www.drupal.org/node/2506757
So I removed the raw filter.
Comment #9
panshulk CreditAttribution: panshulk commentedHi @Fidelix
There are errors Reported by PAreview.sh here.
Please look into the issues reported :)
Comment #10
Fidelix CreditAttribution: Fidelix as a volunteer commented@panshulk, the errors are all false positives.
You can open the files and check the code to verify.
Comment #11
joachim CreditAttribution: joachim commented> It's different from other modules (like https://www.drupal.org/project/twitter_block) because it pulls full twitter PHP objects and therefore can be used to generate any markup necessary.
That is not a sufficient difference. You could file a patch on that module to improve the themeability of its output.
Comment #12
klausiProject duplication is bad but not an application blocker.
Comment #13
Fidelix CreditAttribution: Fidelix as a volunteer commentedSorry @joachim,
But did you even look at what both modules are trying to do?
The approach twitter_block module uses simply does not allow for any kind of theming.
All it takes to understand that is to read the full description of both modules.
One simply outputs a javascript widget using that twitter provides (pre-made, offering no customizing ability).
The other uses oAuth and JSON to build a real block with Drupal's theming layer, and requires developers to actually register an App on Twitter. Output can be fully customized.
How is that not different enough? I would go as far as saying there could possibly be no greater difference between approaches.
I will respectfully move this back to "Needs review".
Comment #14
Fidelix CreditAttribution: Fidelix as a volunteer commented@klausi, thank you but this is not module duplication.
I always do my best to contribute where I can to avoid that, because I understand the consequences of duplication for a community like ours.
If you tell me there is a reasonable way to achieve the result of that screenshot that's on the module's description on twitter_block, I will implement it as a patch instead.
But I know there isn't.
Comment #15
joachim CreditAttribution: joachim commentedMy mistake, I was thinking you meant https://www.drupal.org/project/twitter_pull. That one definitely does allow theming.
Comment #16
joachim CreditAttribution: joachim commentedSorry, didn't see klausi's comment.
Drupal already has too many twitter modules which overlap each other and don't get enough maintenance time. Please don't make that worse.
Comment #17
abhishek.pareek CreditAttribution: abhishek.pareek at Innoraft commentedI did an automated review through PAReview and found a lot of issue http://pareview.sh/pareview/httpgitdrupalorgsandboxfidelix2725795git, you should resolve those first.
Comment #18
Fidelix CreditAttribution: Fidelix as a volunteer commented@abhishek.pareek can you please read the comments before doing something like this?
This was already addressed.
@joachim there is no such thing as overlap for Twitter feeds in D8.
There isn't a single module doing this (not that I found).
I did look at the code of twitter_pull and a port would need an approach from scratch. If you compare the modules, you'd see that 0 lines code from twitter_pull would be reusable.
Comment #19
guilopes CreditAttribution: guilopes commentedI reviewed it and I think it's different enought to be published so I'm updating the issue to review & tested by the community
Comment #20
Fidelix CreditAttribution: Fidelix as a volunteer commentedPlease, any updates here?
Thanks.
Comment #21
joachim CreditAttribution: joachim commented> I did look at the code of twitter_pull and a port would need an approach from scratch. If you compare the modules, you'd see that 0 lines code from twitter_pull would be reusable.
Ok. In which case, please can you add a Twitter Pull issue for the D8 upgrade, saying that people should use your module instead. No point duplicating functionality on D8.
Comment #22
Fidelix CreditAttribution: Fidelix as a volunteer commentedFair point.
I'll do that, but I think it would be better to have a project page first.
Some users might not be comfortable being pointed to a sandbox project (for various reasons).
Comment #23
Fidelix CreditAttribution: Fidelix as a volunteer commentedPlease, can someone move this application forward?
I would really appreciate it.
Comment #24
MiSc CreditAttribution: MiSc commentedThanks for your contribution, Fidelix!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.