Twitter for Wordpress 1.9.7 by Ricardo González. Author: Alexander Hofbauer Author URI: http://derhofbauer.at/blog */ /* Copyright 2007 Ricardo González Castro (rick[in]jinlabs.com) * Copyright 2010 Alexander Hofbauer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ define('MAGPIE_CACHE_ON', 1); //2.7 Cache Bug define('MAGPIE_CACHE_AGE', 180); define('MAGPIE_INPUT_ENCODING', 'UTF-8'); define('MAGPIE_OUTPUT_ENCODING', 'UTF-8'); if (!class_exists("AJAXedTwitter")) { class AJAXedTwitter { public static function init() { // this will automatically add the MooTools Class "Twitter" to wp_head(); if (!is_admin()) wp_enqueue_script('ajaxed-twitter', self::plugin_path().'/js/Twitter.js'); } /** * Get Twitter messages */ public static function messages(array $options = array()) { include_once(ABSPATH.WPINC.'/rss.php'); $options = array_merge(array( 'username' => '', 'num' => 1, 'list' => false, 'update' => true, 'linked' => '#', 'hyperlinks' => true, 'twitter_users' => true, 'encode_utf8' => false, 'error_id' => '' ), $options); $options['error_id'] = ($options['error_id']) ? 'id="'.$options['error_id'].'"' : ''; $output = ''; $messages = fetch_rss('http://twitter.com/statuses/user_timeline/'.$options['username'].'.rss'); if ($options['list']) $output = '