Ejemplo n.º 1
0
      </ul>
    </div>

	<!--
	<div class="advertencia">
		<div class="logoLeft"></div>
		<div class="info"><span class="title">Paro escalonado 06/12:</span><span class="lineaA"> Linea A:</span> 08 - 10 hs. | <span class="lineaB">Linea B:</span> 10 - 12 hs. | <span class="lineaC">Linea C:</span> 12 - 14 hs. |  <span class="lineaD">Linea D:</span> 14 - 16 hs. | <span class="lineaE">Linea E:</span> 16 - 18 hs. | <span class="lineaH">Linea H:</span> 16 - 18 hs. | <span class="lineaP">Premetro:</span> 16 - 18 hs.</div>
		<div style="clear: both"></div>
	</div>
	-->

	<div style="clear: both"></div>
    <footer>
      <div class="social">
        <a href="https://twitter.com/share" class="twitter-share-button" data-text="<?php 
echo getTweetText($data);
?>
" data-lang="es">Twittear</a>
        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="http://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
        <div class="fb-like" data-href="http://www.haysubtes.com" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div>
      </div>

      <div class="texto-bonito"><p>El estado de subtes de <a href="http://www.haysubtes.com">haysubtes.com</a> se actualiza cada 2 minutos. :)</p></div>

      <div class="quote"><a href="http://www.twitter.com/celestineia" target="_blank">Cerebro</a> - <a href="http://www.twitter.com/aguagraphics" target="_blank">Art</a> - <a href="http://www.twitter.com/blaquened" target="_blank">Layout</a> - Pinky - <a href="http://www.twitter.com/chompas" target="_blank">Master Shake</a> </div>
    </footer>
  </body>

  <script type="text/javascript">

    var _gaq = _gaq || [];
Ejemplo n.º 2
0
/**
 * Parses JSON object for tweets, gets sentiment object & writes to file with date
 * @param array of JSON data, number of tweets to analyze
 */
function parseData($arr, $num)
{
    global $path;
    $count = 0;
    $flag = file_exists($path);
    $res = array();
    //for debug
    $ind = 0;
    foreach ($arr as $tweet) {
        if ($flag == true) {
            $flag = false;
            continue;
        }
        $date = getTweetDate($tweet);
        $id = getTweetID($tweet);
        $str = getTweetText($tweet);
        $str = cleanTweet($str);
        if (strlen($str) < 5) {
            continue;
        }
        //using alchamy
        $sentiment = getTweetSentiment($str);
        $result = array();
        $result[0] = $id;
        $result[1] = $date;
        $result[2] = $str;
        $result[3] = $sentiment->type;
        $result[4] = $sentiment->score;
        $resultString = getCacheString($result);
        writeInfo($result);
        writeData($resultString);
        $res[$ind++] = $resultString;
        if ($count > $num) {
            break;
        }
        $count++;
    }
    return $res;
}