Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F30041251
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Smalyshev
Aug 15 2019, 7:53 PM
2019-08-15 19:53:58 (UTC+0)
Size
785 B
Referenced Files
None
Subscribers
None
raw.txt
View Options
<?php
$NS = "0|120|146";
$url = "https://www.wikidata.org/w/api.php?format=json&action=query&list=recentchanges&rcdir=newer&rcprop=title|ids|timestamp&rcnamespace=$NS&rclimit=500";
$start = '20190813103000';
// $end does not really work for now
// $end = '20190813122000';
$url_data = $url . "&rcstart=" . $start;
do {
$data = file_get_contents($url_data);
$cont = process_data($data);
$url_data = $url . "&continue=-||&rccontinue=" . $cont;
print "Continuing with $cont\n";
} while($cont);
function process_data($data) {
$jdata = json_decode($data, true);
$rc = $jdata['query']['recentchanges'];
foreach($rc as $rcitem) {
// if($rcitem['type'] != 'log') continue;
print $rcitem['title'] . " " . $rcitem['timestamp'] . "\n";
}
return $jdata['continue']['rccontinue'];
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7855888
Default Alt Text
raw.txt (785 B)
Attached To
Mode
P8919 RC fetching script
Attached
Detach File
Event Timeline
Log In to Comment