ok these are excerpts from the twitter class that you can use in the iOS app to access its API which is REST i think:
they post to their data stores:
@"http://%@/statuses/user_timeline/%@.json"
@"status=%@"
@"http://%@:%@@%@/statuses/update.json"
which are all via HTTP POST
and they read the data:
@"http://%@/users/show/%@.json"
@"http://%@/statuses/user_timeline/%@.json"
Thats why im thinking they create user.json files, which would be inefficient because once that file is created it must then be erased, so it would just be easier to make a generic readtags.php script and have it spit out the data, which is where im at right now. so i could just say:
http://www.server.com/app/readtag.php?user=phpbuilder and have the php file incorporate the variable into its query and spit out the correct json enocded data, right?
One more thing, this is the code im currently using:
<?php
include_once("JSON.php");
$json = new Services_JSON();
$link = mysql_pconnect("localhost", "user", "paas") or die("Could not connect");
mysql_select_db("app") or die("Could not select database");
$query = "SELECT * FROM tags";
$arr = array();
$rs = mysql_query("SELECT * FROM users");
while($obj = mysql_fetch_object($rs)) {
$arr[] = $obj;
}
Echo $json->encode($arr);
?>
which you can see just spits out the entire users table in this format:
[
{"id":"1","name":"user","pass":"","udid":"269d40ba 6575b9ec51a7f3237e757c2bcd6bf6","timestamp":"0000-00-00 00:00:00","reglocation":""},
{"id":"2","name":"other","pass":"","udid":"2031aaf b778b3a27635ae38e4315f31bba956805","timestamp":"00 00-00-00 00:00:00","reglocation":""},
{"id":"4","name":"hers","pass":"","udid":"F6869 FB4-2EBE-5D43-A62D-5D4007646764","timestamp":"2010-09-18 11:15:16","reglocation":""},
{"id":"5","name":"his","pass":"","udid":"adf03902c 18974c9d29edf27da779afa66438a3b","timestamp":"2010-09-18 11:18:52","reglocation":""}
]
which is an array of dictionaries. Once i pass it the specific name, such as getusers.php?user=hers then it will only spit out:
{"id":"4","name":"hers","pass":"","udid":"F6869 FB4-2EBE-5D43-A62D-5D4007646764","timestamp":"2010-09-18 11:15:16","reglocation":""}
which is a dictionary, correct? Then i get the objectForKey:name and get its value, add it to an array and use it to populate a VC....