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.

CommentFileSizeAuthor
CoOpp3.png34.75 KBFidelix
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Fidelix created an issue. See original summary.

PA robot’s picture

Status: Needs review » Needs work

There 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.

Fidelix’s picture

Status: Needs work » Needs review

The messages are false positives. Stuff on the included libraries.

klausi’s picture

Status: Needs review » Needs work
PAReview: 3rd party code
jquery.timeago.min.js appears to be 3rd party code. 3rd party code is not generally allowed on Drupal.org and should be deleted. This policy is described in the getting involved handbook. It also appears in the terms and conditions you agreed to when you signed up for Git access, which you may want to re-read, to be sure you're not violating other terms.

The Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on Drupal.org.

Fidelix’s picture

Status: Needs work » Needs review

@klausi, 3rd party code removed, and some extra fixes performed.

flocondetoile’s picture

Issue summary: View changes

project page added in issue summary

flocondetoile’s picture

Status: Needs review » Needs work

HI @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.

Fidelix’s picture

Status: Needs work » Needs review

Hello @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.

panshulk’s picture

Status: Needs review » Needs work

Hi @Fidelix

There are errors Reported by PAreview.sh here.
Please look into the issues reported :)

Fidelix’s picture

Status: Needs work » Needs review

@panshulk, the errors are all false positives.
You can open the files and check the code to verify.

joachim’s picture

Status: Needs review » Needs work

> 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.

klausi’s picture

Status: Needs work » Needs review

Project duplication is bad but not an application blocker.

Fidelix’s picture

Sorry @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".

Fidelix’s picture

@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.

joachim’s picture

Status: Needs review » Needs work

My mistake, I was thinking you meant https://www.drupal.org/project/twitter_pull. That one definitely does allow theming.

joachim’s picture

Status: Needs work » Needs review

Sorry, 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.

abhishek.pareek’s picture

I did an automated review through PAReview and found a lot of issue http://pareview.sh/pareview/httpgitdrupalorgsandboxfidelix2725795git, you should resolve those first.

Fidelix’s picture

@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.

guilopes’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed it and I think it's different enought to be published so I'm updating the issue to review & tested by the community

Fidelix’s picture

Please, any updates here?

Thanks.

joachim’s picture

> 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.

Fidelix’s picture

Fair 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).

Fidelix’s picture

Please, can someone move this application forward?

I would really appreciate it.

MiSc’s picture

Status: Reviewed & tested by the community » Fixed

Thanks 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.