Community Documentation

Update your site slogan with Twitter

Last updated February 9, 2012. Created by psydone on October 2, 2009.
Edited by froboy, steinmb. Log in to edit this page.

Themers/Designer - A simple example of the module put to use would be using the twitter_fetch_timeline call to retrieve a users timeline and insert the resulting text into the site_slogan variable.

<?php
$twarray
= twitter_fetch_timeline('username');
$site_slogan = $twarray[0][text];
?>

Placing this text nearest the top of a theme page such as page.tpl.php. Will subscribe the site slogan to the 'username's latest tweet posting.

Please note this can/does affect performance. Improvements to the documentation are welcome.

Comments

WSOD

Did anyone else try this and get a White Screen of Death?

The function is 'twitter_fetch_user_timeline' NOT 'twitter_fetch_timeline'.

Confused

Not sure I understand what this means? What does "Will subscribe the site slogan to the 'username's latest tweet posting." mean exactly?

site slogan is updated with latest tweet

I believe it means that the site slogan on your Drupal site will automatically be updated to the latest tweet.

IOW:

$twarray = twitter_fetch_timeline('username');  // get the latest tweet from 'username'
$site_slogan = $twarray[0][text];  // update the site slogan with the tweet

function not found

i get function not found error for both twitter_fetch_user_timeline and twitter_fetch_timeline.
I have the twitter module installed v3. Is there anything else i need to do?
Thanks

ISIMO web developmet

This approach is not wise.

This approach is not wise. Please see #1261704: Add a hook when Tweets are saved at hook_twitter_status_save() for a better approach.

Page status

Needs technical review

Log in to edit this page

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Audience
Designers/themers, Programmers, Site administrators
Level
Intermediate, Advanced

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here