On Mon, Mar 31, 2008 at 10:16 PM, <magnusmanske(a)svn.wikimedia.org> wrote:
+
+// Fake user agent
+ini_set('user_agent','MSIE 4\.0b2;');
+
You should probably fake your own user agent? Something like commonsapi/1.0
+// get file data via "normal" API
+$ii_url =
"http://commons.wikimedia.org/w/api.php?format=php&action=query&prop=imageinfo&iilimit=500&iiprop=timestamp|user|url|size|sha1|metadata&titles=Image:"
. $img ;
Needs an urlencode($img);
+ if ( $m == 'Quality images' ) {
+ $titles['qualityimage'] = 1 ; // Just to make sure...
+ continue ;
+ }
+ if ( substr ( $m , 0 , 19 ) == 'Pictures of the day' ) {
+ if ( !isset ( $titles['potd'] ) ) $titles['potd'] = trim ( substr (
$m , 21 , 4 ) ) . "0000" ;
+ continue ;
+ }
You can get this as well from the [[Commons:Machine readability]]
system.
Looks nice :) I would like to co-maintain this but unfortunately I
already have too much work at my hands :( I'll probably be committing
some occasional stuff to svn.
Bryan