How to tell if a website uses JSON or XML and how to pull that data?



I cannot for the life of me find any resources for the above. What I'm attempting to do is discover if the website I am looking at uses JSON or XML, and then to pull that data. I understand that is a complicated question, so if anyone has any resources I would appreciate it. What I have now is a UITableViewController and in its initWithStyle: method I include my own method call of "fetch feed." My fetch feed method looks like so:



- (void)fetchFeed
{
NSString *requestString = @"http://ift.tt/1DzDEfp";
NSURL *url = [NSURL URLWithString:requestString];
NSURLRequest *req = [NSURLRequest requestWithURL:url];

NSURLSessionDataTask *dataTask =
[self.session dataTaskWithRequest:req
completionHandler:
^(NSData *data, NSURLResponse *response, NSError *error) {

NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data
options:0
error:nil];

NSString *json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@", json);
NSLog(@"%@", jsonObject);

dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
}];
[dataTask resume];
}


I'm so confused. What is mySQL? What is github? If I'm looking to have a sport's team's schedule represented in a table view but the website doesn't even have JSON or XML but uses images (pictures of a calendar), can I create my own JSON data on xcode and put this on a server using mySQL or github?


Thanks.


No comments:

Post a Comment