Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. <?
  3.     header('Access-Control-Allow-Origin: *');
  4.     header('content-type: application/json; charset=utf-8');
  5.  
  6.     include_once '../model/RSSParser.class.php';
  7.     include_once '../model/News.class.php';
  8.     include_once '../util/util.class.php';
  9.  
  10.     $util = new Util();
  11.  
  12.     $folha_news = new News($_GET['rss_url']);
  13.    
  14.     // echo $util->JSON_prettyPrint(json_encode($folha_news->array_news));
  15.    
  16.     /**
  17.      *  func is a Javascript function defined in default.js
  18.      *
  19.      *      $_GET['element']    is the id of the element on the DOM ( will be filled with the news array ),
  20.      *                          if you pass w/o quotes you pass the global variable ( that represents the HTML Object )
  21.      *                          to the javascript otherwise you pass it's ID
  22.      */
  23.     echo "func('".json_encode($folha_news->array_news)."',{$_GET['element']},{$_GET['qtd']})";
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement