Addshore has submitted this change and it was merged.

Change subject: Use json api for showcase items
......................................................................


Use json api for showcase items

Change-Id: I477ff3f85b1b874979034211bfd8782fc29a6a6e
---
M graphite/showcase.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Addshore: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/graphite/showcase.php b/graphite/showcase.php
index adc61e1..7b616c4 100755
--- a/graphite/showcase.php
+++ b/graphite/showcase.php
@@ -7,14 +7,14 @@
 
 require_once( __DIR__ . '/../src/WikimediaCurl.php' );
 
-$url = 
'https://www.wikidata.org/w/api.php?action=query&prop=revisions&titles=Wikidata:Showcase_items&rvprop=content';
+$url = 
'https://www.wikidata.org/w/api.php?action=query&prop=revisions&format=json&titles=Wikidata:Showcase_items&rvprop=content';
 $json = WikimediaCurl::curlGet( $url );
 
 if( $json === false ) {
        throw new RuntimeException( "Failed to get showcase items from API" );
 }
 
-$json = json_decode( $json, true );
+$json = json_decode( $json[1], true );
 $pageArray = array_pop( $json['query']['pages'] );
 $pageContent = $pageArray['revisions'][0]['*'];
 

-- 
To view, visit https://gerrit.wikimedia.org/r/260556
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I477ff3f85b1b874979034211bfd8782fc29a6a6e
Gerrit-PatchSet: 1
Gerrit-Project: analytics/limn-wikidata-data
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to