2016-05-23 2 views

Antwort

0

fand ich einen Weg mit parsely:

/* 
    Function to return latest post, which are retrived from Parse.ly's API 
*/ 
    public static function get_most_viewed_homepage_articles ($limit=6) { 
     $attr= array('apikey' => "YOUR_API_KEY", 
       "secret" => "YOUR_API_SECRET", 
       "page" => "1", 
       "limit" => "$limit", 
       "time" =>"5m"); 
     $url="https://api.parsely.com/v2/realtime/posts"; 
     $url.="?"; 
     reset($attr); 
     while(list($attr_key, $attr_val) = each($attr)){$url.=$attr_key."=".$attr_val."&";} 
     $result = @file_get_contents($url); 
     $result_json = json_decode($result, true);  
     return $result_json;   
    } 

Das ist für mich gearbeitet. Ich benutzte es auf function.php

Verwandte Themen