Jump to content

Twitter Feed (MarkupTwitterFeed)


ryan

Recommended Posts

There was a request that I add an official thread for this module, so here it is. MarkupTwitterFeed generates a feed of your tweets that you can output on your site. When you view the processwire.com homepage and see the latest tweets in the footer, this module is where they are coming from. This module was recently updated to support Twitter's new API which requires oAuth authentication. 

Link to comment
Share on other sites

  • 1 year later...

hey.

On the weekend i went to visit a site I recently "finished" (they're never really finished) and it uses the markuptwitterfeed module. I noticed the latest tweet included an ampersand and it was displaying "&".

Looking at the source markup I found:

<li><span class='date'>Dec 2, 2012</span><br /> A lady 80 and a guy 79 called, excited & looking to help CEP.</li>

which makes it look as if it's trying to entity encode something that was already encoded. Going to the page on twitter it displays correctly.

Is this the result of me screwing something up in the setup? I can't really see how I could have but searching the forum I can't find any report of this happening and ampersands on twitter have to be pretty common.

Link to comment
Share on other sites

  • 6 months later...

There was a request that I add an official thread for this module, so here it is. MarkupTwitterFeed generates a feed of your tweets that you can output on your site. When you view the processwire.com homepage and see the latest tweets in the footer, this module is where they are coming from. This module was recently updated to support Twitter's new API which requires oAuth authentication. 

  • Like 4
Link to comment
Share on other sites

Thanks ryan - used this at the weekend to replace a home-brewed bit of code I was using that didn't work after the Twitter API 1.1 update.

The markup options were especially handy as it meant I didn't have to change my template code much at all :)

  • Like 1
Link to comment
Share on other sites

Updated version to 2.0.1 which adds a 'relative' option for the date/time stamp setting. That makes it display the time as strings like "5 minutes ago", etc. The other change is that the module can now be iterated with a foreach(), useful for people that want to handle all of their own markup generation. If you take this approach, be sure to read the example and notes in the readme file. 

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...
  • 1 month later...

I get an error with this info in error-log: {"errors":[{"message":"Bad Authentication data","code":215}]}

I have checked the authentication data many times, but don't know how to further debug this. Could someone help?

EDIT: Is this module supposed to work when my site is not yet on public IP? Can Twitter authentication work when PW is on localhost in home network?

Link to comment
Share on other sites

@lpa: I'm seeing this issue too, can't quite figure out what's causing it yet though. Twitter authentication should work from localhost, at least as long as callbacks etc. are set properly (quite a few topics about this if you try Googling).

Twitter's oAuth test (cURL) is working from localhost, but the module doesn't. I'd check if code samples in tmhOAuthExamples work either, but don't really have the time right now.

Link to comment
Share on other sites

@lpa: I'm seeing this issue too, can't quite figure out what's causing it yet though. Twitter authentication should work from localhost, at least as long as callbacks etc. are set properly (quite a few topics about this if you try Googling).

Twitter's oAuth test (cURL) is working from localhost, but the module doesn't. I'd check if code samples in tmhOAuthExamples work either, but don't really have the time right now.

The same here. Get the module not to work. The feed is loaded and cached, then crashes the Apache (WAMP environment, PHP 5.3.8 + Apache 2.2.22). In the error log (PHP, PW or Apache) there is no entry. Very kurrios. On the production server I have not tried it yet.

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...

Hi makari,

I was lloking for the exact same thing some time ago. I wrote a pull request to add this functionality, you can check it out here: https://github.com/ryancramerdesign/MarkupTwitterFeed/pull/3

Unfortunately, the best solution I could come up with was fetching all tweets and then filter them. If you know a way to do this right from the twitter API, I would be glad to here about it.

Link to comment
Share on other sites

  • 4 weeks later...

Hello,

is there a possibility to put the url from a tweet into a real link?

$t->linkUrls = true; as an option doesn´t work unfortunately.

Doesn't work here either.

Also @ Mentions and # Hashtags.

This is what it looks like:

0cJXa2u.png

These are my options set:

<?php

    $t = $modules->get('MarkupTwitterFeed');
    $t->limit = 20;
    $t->linkUrls = true;
    $t->showHashTags = true;
    $t->showAtTags = true;
    $t->showDate = 'after';
    // generated markup options:
    $t->listOpen = "";
    $t->listClose = "";
    $t->listItemOpen = '<div class="feed">';
    $t->listItemClose = "</div>";
    $t->listItemDateOpen = "<span class='date'>";
    $t->listItemDateClose = "</span>";
    echo $t->render();
?>

Hope you guys can help me out.

But I think the structure of twitterJSON changed, so that might be a reason.

Link to comment
Share on other sites

Hi Misan,

are you talking about turning Mentions, Hashtags and URLs inside the tweet into links? If that's the case, that should be easy to implement. I guess I did this for a project some time ago. I'll have a look into the code when I'm home, maybe that's what you are looking for :-)

Hi there!

Yep, I would like to have @ at-tags linked to the said twitter profile.

I thought thats possible with the default twitter module?

Thanks in advance!

Link to comment
Share on other sites

  • 2 months later...

how to call image twitter use module Markup Twitter Feed ?? please help me 

If your question, it is about how to display images in tweets, the default module markup does not handle images.

But that is not hard to do: you have to use a foreach loop to iterate over the tweets and create your own markup inside the loop, like in the example in the  readme.

$t = $modules->get('MarkupTwitterFeed');
$t->limit = 3; 
foreach($t as $item) {
  echo "<p>$item[text]<br /><span class='date'>$item[created_at]</span></p>";
}

For the internal structure of twitter media, you can have a look at https://dev.twitter.com/overview/api/entities-in-twitter-objects

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...