def mw_search(server, query, num):
 search_url = (u'http://%s/w/api.php?format=json&action=query&list=search&srlimit=%d&srprop=timestamp&srwhat=text&srsearch=' % (server, num))
 search_url += query
 query = json.loads(web.get(search_url))
 if (u'query' in query):
  query = query[u'query'][u'search']
  return [r[u'title'] for r in query]
 else:
  return None

def mw_search ( server , query , num ) : search_url = ( u'http://%s/w/api.php?format=json&action=query&list=search&srlimit=%d&srprop=timestamp&srwhat=text&srsearch=' % ( server , num ) ) search_url += query query = json . loads ( web . get ( search_url ) ) if ( u'query' in query ) : query = query [ u'query' ] [ u'search' ] return [ r [ u'title' ] for r in query ] else : return None
searches the specified mediawiki server for the given query .