Homework 3 – meierdg
November 6, 2011 by meierdg. Filed under
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
cs491 mobile, fall 2011, postmortems.
I attempted to modify my fortune cookie for program 2 to go out to a web api to retrieve their fortunes as well. I did this in part to show that all programs can be improved in one way or another, and mainly because my free time is vastly limited by my two jobs. In the end, however, it saved me no time and didn’t even provide me with a working program. I tried using the API set up at https://github.com/FernFerret/Fortune to retrieve fortune in the database set up by Dr. Fisher, however no matter which way I attempted to send in my JSON (the api requires a JSON to be sent in, and returns a JSON) I got an html result boiling down to (what I believe) saying that my JSON was empty. However through debugging I know that it was filled with the proper requirements, and tried multiple different ways of sending in my JSON. The plan was just to receive their fortune via JSON after pressing “Get a random fortune!” and adding it to the database used in the application. The app would then proceed as normal afterwards.
On the plus side, from doing this I realized that it would be much easier to use an API that just allows me to use a modified URL to receive a result to have one way of knowing I “asked” for a result correctly.
The html returned:
<!DOCTYPE html>
<html lang=’en’>
<head>
<meta content=’text/html; charset=ISO-8859-1′ http-equiv=’Content-Type’ />
<title>Fortune</title>
<link href=’/css/style.css’ media=’screen’ rel=’stylesheet’ />
</head>
<body>
Example: {“id”: “1”}
<br />
or: {“random”: “true”}
<br />
Note that if an id is specified it will take priority over the random tag
<br />
You tested a post of the following, but it was invalid:
<br />
<strong>
Raw JSON:
</strong>
<br />
<br />
<strong>
The Verdict:
</strong>
<br />
INVALID JSON STRING GIVEN
<br />
<form action=” method=’post’>
<textarea name=’data’></textarea>
<input type=’submit’ value=’Submit JSON’ />
</form>
</body>
</html>