Esempio n. 1
0
<div class="title-section">
	<div>
		<p dir="ltr" class="title">Put here your new brand</p>
		<p dir="ltr" class="subtitle">Follow ours latest news in live</p>
	</div>
</div>
<div id="flux-twitter" class="flux">
	<span class="logo">
		<a id="logo-twitter" href="#">
			<img width="40" height="40" alt="Logo Twitter" src="images/logo-twitter.jpg">
		</a>
	</span> 
	<div class="container-gallery-txt">
		<ul class="gallery">
		<?php 
printTweets($twitter_username, $max_tweets);
?>
		</ul>
	</div>
	<ul class="nav">
		<li id="prev-tweet" class="prev can-prev"><a href="#prev">Previous</a></li>
		<li id="next-tweet" class="next"><a href="#next">Next</a></li>
	</ul>
</div>
<div id="flux-youtube" class="flux">
	<span class="logo">
		<a id="logo-youtube" href="#">
			<img width="40" height="40" alt="Logo Youtube" class="logo" src="images/logo-youtube.jpg"> 
		</a>
	</span>
	<div class="container-gallery">
Esempio n. 2
0
<?php

$cache_file = '../tmp/twittercache.csv';
try {
    updateTwitterCache($cache_file);
    printTweets($cache_file);
} catch (Exception $e) {
    echo '<div id="tweet_top"> </div>';
    echo '<div id="tweet_middle">';
    echo '<div id="tweet_message">';
    echo '<b>There was an error retrieving twitter data.</b>';
    echo '</div></div>';
    echo '<div id="tweet_bottom"></div>';
}
function updateTwitterCache($cache_file)
{
    if (!file_exists($cache_file)) {
        $file = fopen($cache_file, "w");
        //changed r to w
        fclose($file);
    }
    if (time() - filemtime($cache_file) >= 90) {
        require "twitter.lib.php";
        require "config.php";
        $twitter = new Twitter($twitteruser, $twitterpass);
        $xml = $twitter->getMentions();
        $twitter_status = new SimpleXMLElement($xml);
        $fp = fopen($cache_file, 'w');
        //changed twitter.csv to $cache_file
        foreach ($twitter_status->status as $status) {
            foreach ($status->user as $user) {