Advertisement
acegiak

mf2 parse?

Feb 12th, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1.         function whisperfollow_mf2_read($page){
  2.             $output = Mf2\parse(curldo($page),$page);
  3.             foreach($output->items as $item){
  4.                 if($item->type == "h-feed"){
  5.                     foreach($item->children as $child){
  6.                         if(in_array("h-entry",$child->type)){
  7.                             try{
  8.                                 whisperfollow_log("<br/>got ".$child->properties->name[0]." from ". $item->properties->name[0]."<br/>");
  9.                                 add_whisper($child->properties->url[0],$child->properties->name[0],$child->properties->content[0]->html,$item->properties->name[0],$page,strtotime($item->properties->published[0])->format( 'U' ));
  10.                             }catch(Exception $e){
  11.                                 whisperfollow_log("Exception occured: ".$e->getMessage());
  12.                             }
  13.                         }
  14.                     }
  15.                 }
  16.             }
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement