This is a request to add a hook to modify the tweet content before sending it to the theming layer. I'm thinking specifically of the twitter_pull_render function, adding something like this right after twitter_pull_retrieve:

module_invoke_all('twitter_pull_modify', $tweets);

That way I can add a hook in my custom module to modify the tweet appropriately.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjbrown99’s picture

Status: Active » Reviewed & tested by the community
FileSize
441 bytes

Here's a patch. I'm marking RTBC only because it's a one liner to add the hook.

jec006’s picture

I'm leaving this issue open for d6, but I committed to d7. Thanks

http://drupal.org/commitlog/commit/12844/27daa46d5f229a7e00dc364f49c11cb...

thehong’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

module_invoke_all() is used for collecting result, not to modify content. Please use drupal_alter instead.

thehong’s picture

Status: Reviewed & tested by the community » Needs review

Here's patch.

thehong’s picture

FileSize
1.3 KB
thehong’s picture

Status: Needs review » Needs work

No longer applicable.

thehong’s picture

Status: Needs work » Needs review
FileSize
1.24 KB

Reroll.

thehong’s picture

FileSize
1.26 KB
thehong’s picture

FileSize
1.26 KB

My bad ;(

thehong’s picture

Category: feature » bug
Priority: Normal » Major

Maintainer, can you review and apply my patch?

elliotttf’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me and is indeed the correct way to alter content that's passed by reference.

It might be worth it to include some of the other arguments that were passed to tiwtter_pull_render so that alter functions can have some context about which list of tweets they are altering, but that might belong in another ticket.

+1 on getting this committed as what's in there currently is not useful.

elliotttf’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.41 KB

Ok, I immediately ran into a case where I needed the pieces that are used to retrieve tweets, so here's the patch re-rolled with that stuff added.

elliotttf’s picture

Whoops, let's try that again with the correct arguments in the API example...

elliotttf’s picture

Wow, I'm not having a good day, here's the patch with no syntax errors...

bnash2501’s picture

Rerolled the patch from elliotttf to fix spacing and allow twitter_pull.api.php to be patched in.

Robert_W’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This still isn't committed. I tried the latest patch in #15 and it still applies to the 2.0-alpha3. Can this be committed? This is a feature that needs to be implemented.