Created
October 3, 2015 19:50
-
-
Save mc256/bfcc08f6e0fe67c4b21b to your computer and use it in GitHub Desktop.
mediawiki api swift handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pageRawData:NSData = try NSData(contentsOfURL: targetURL, options: []) | |
var tempData:NSDictionary = try NSJSONSerialization.JSONObjectWithData(pageRawData, options:.MutableContainers ) as! NSDictionary | |
tempData = tempData.objectForKey("query")!.objectForKey("pages") as! NSDictionary | |
tempData = tempData.objectForKey(tempData.keyEnumerator().nextObject()!) as! NSDictionary | |
let content = tempData.objectForKey("revisions")?.objectAtIndex(0).objectForKey("*") as! String | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment