public function getArticleImages($i = null, $image_min_size = 0)
    {
        $result = [];

        $i = count($this->article_ids) > 1 ? $i : 0;
        $article_ids = ($i === null) ? $this->article_ids : [$this->article_ids[$i]];

        foreach ($article_ids as $page_id) {
            $result[$page_id] = [];
            $wiki_api = $this->base_api . 'action=query&generator=images&prop=imageinfo&iiprop=url|size&pageids=' . $page_id;
            $json_wapi = json_decode(file_get_contents($wiki_api), true);

            if (!$json_wapi) {
                return [];
            }

            foreach ($json_wapi['query']['pages'] as $item) {
                $imageinfo = $item['imageinfo'][0];
                if ($image_min_size > 0 && $imageinfo['size'] < $image_min_size) {
                    continue;
                }

                $result[$page_id][] = $imageinfo['url'];
            }
        }

        return ($i === null) ? $result : $result[$this->article_ids[$i]];
    }
public function getArticleImages($i = null, $image_min_size = 0)
    {
        $result = [];

        $i = count($this->article_ids) > 1 ? $i : 0;
        $article_ids = ($i === null) ? $this->article_ids : [$this->article_ids[$i]];

        foreach ($article_ids as $page_id) {
            $result[$page_id] = [];
            $wiki_api = $this->base_api . 'action=query&generator=images&prop=imageinfo&iiprop=url|size&pageids=' . $page_id;
            $json_wapi = json_decode(file_get_contents($wiki_api), true);

            if (!$json_wapi) {
                return [];
            }

            foreach ($json_wapi['query']['pages'] as $item) {
                $imageinfo = $item['imageinfo'][0];
                if ($image_min_size > 0 && $imageinfo['size'] < $image_min_size) {
                    continue;
                }

                $result[$page_id][] = $imageinfo['url'];
            }
        }

        return ($i === null) ? $result : $result[$this->article_ids[$i]];
    }
public function getArticleImages ( $ i = null , $ image_min_size = 0 ) { $ result = [ ] ; $ i = count ( $ this -> article_ids ) > 1 ? $ i : 0 ; $ article_ids = ( $ i === null ) ? $ this -> article_ids : [ $ this -> article_ids [ $ i ] ] ; foreach ( $ article_ids as $ page_id ) { $ result [ $ page_id ] = [ ] ; $ wiki_api = $ this -> base_api . 'action=query&generator=images&prop=imageinfo&iiprop=url|size&pageids=' . $ page_id ; $ json_wapi = json_decode ( file_get_contents ( $ wiki_api ) , true ) ; if ( ! $ json_wapi ) { return [ ] ; } foreach ( $ json_wapi [ 'query' ] [ 'pages' ] as $ item ) { $ imageinfo = $ item [ 'imageinfo' ] [ 0 ] ; if ( $ image_min_size > 0 && $ imageinfo [ 'size' ] < $ image_min_size ) { continue ; } $ result [ $ page_id ] [ ] = $ imageinfo [ 'url' ] ; } } return ( $ i === null ) ? $ result : $ result [ $ this -> article_ids [ $ i ] ] ; }
Get Images of the Articles
@param  integer  $i
@param  integer $image_min_size
@return array
Get Images of the Articles