I have a requirement to display a single tweet, either based on the Twitter URL or ID, whichever is easier. For example, I'd like to say something like

twitter_pull_render('http://twitter.com/#!/Nate_Dogs/status/149535084565905408');

or

twitter_pull_render('149535084565905408');

and see this single tweet rendered in the page. Is this possible with Twitter Pull?

Comments

relaxnow’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Category: support » feature
Status: Active » Needs review
StatusFileSize
new1013 bytes

Added a patch we're using to implement this.

Here is how we use it:

      <?php
        // Load the tweet
        $uri = render($content['field_tweet_link']);

        $result = twitter_pull_retrieve('#' . basename($uri), null, 1);

        // Get the single tweet
        $tweet = count($result) === 1 ? $result[0] : array();
        $tweet = get_object_vars($tweet);

        // Convert tweet hashtags as links
        $text = twitter_pull_add_links($tweet['text']);
        $nameLink = twitter_pull_add_links('@' . $tweet['username']);
      ?>

      <img src="<?= $tweet['userphoto']; ?>" alt="twitter thumbnail"/>

      <p>&ldquo;<?= $text; ?>&rdquo; <b st><?= $nameLink; ?> on Twitter </b></p>
bblake’s picture

StatusFileSize
new1.67 KB

Ran into this issue and didn't see this until now, have a separate patch that I'm using
( apologies - also includes http://drupal.org/files/twitter_pull-retweet-user-1935318-3.patch )

Anonymous’s picture

Issue summary: View changes
StatusFileSize
new1.61 KB

Applied most of what was in #2 to latest dev. Some of it seemed to be already there.

melvinlouwerse’s picture

Update patch to apply to latest 2.x-dev.

joachim’s picture

Status: Needs review » Needs work

Isn't using a # going to be really confusing with hashtags?