Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Storytelling By Numbers

22,268 views

Published on

Mike King's Marketing Festival presentation on using APIs and visualizing data.

Published in: Data & Analytics, Marketing
  • Login to see the comments

Storytelling By Numbers

  1. @iPullRank
  2. @iPullRank
  3. @iPullRank
  4. @iPullRank
  5. @iPullRank
  6. @iPullRank
  7. @iPullRank
  8. <?php ?>
  9. // This is a comment /* This is also a comment on multiple lines*/
  10. $a = 5;
  11. + – / *
  12. $f = ‘marketing’ . ’festival’; // Sets the value of $f to “marketingfestival”
  13. if ( condition ) { do things } elseif( condition) { do other things } else{ do other things }
  14. $a = 50; if($a ==49) { echo “a is 49”; } elseif($a == 52) { echo “a is 52”; } else{ echo “a is not a known number”; }
  15. while foreach for (initial value of counter; loop ending condition; counter increment or decrement) { do things }
  16. $count = 40; For ($x=1;$x<($count+1);$x++) { echo $x . “<Br/>”; }
  17. $count = 40; For ($x=1;$x<$count;$x++) { for ($y=0;$y<10;$y++) { echo $x+$y . “<Br/>”; } }
  18. $variable[0] = “this is first element of an array”; $variable[1] = “this is second element of an array”;
  19. $variable[“element”] = “this is first associative element of an array”; $variable[“second”] = “this is second associative element of an array”;
  20. $variable[“element”][“score”]= 80; $variable[“second”][5] = “this is the 6 element within the second element”;
  21. <?php include_once“csv-handlers.php”; $csv = csv_to_array(“insert file name here.csv”);
  22. <?php include_once“csv-handlers.php”; $csv = csv_to_array(“example.csv”); print_r($csv);
  23. <?php include_once"restclient.php"; $api= new RestClient(array( 'base_url' => "http://urls.api.twitter.com/1/urls", 'format' => "json" )); $response = $api->get("count", array("v" => "1.0", "url" =>"http://www.marketingfestival.cz"));
  24. if($response->info->http_code== 200) { $twitterResponse= $response->decode_response(); echo 'tweet count is ' .$twitterResponse->count; }
  25. <?php include_once“csv-handlers.php”; makeCSV($csv, “test.csv”);
  26. <?php include_once"restclient.php"; include_once"csv-handlers.php"; $csv = csv_to_array("urls.csv"); $countOfCsvLines= count($csv); $api= new RestClient(array( 'base_url' => "http://urls.api.twitter.com/1/urls", 'format' => "json" )); echo '<Table><tr><td>URL</td><td>Tweet Count</td></tr>';
  27. for($x=0;$x<$countOfCsvLines;$x++) { echo '<tr>'; $result = $api->get("count", array("v" => "1.0", "url" =>$csv[$x]['urls'])); echo '<td>'.$csv[$x]['urls'].'</td>'; if($result->info->http_code== 200) { $twitterResponse= $result->decode_response(); $socialShares[$x]['urls'] = $csv[$x]['urls']; $socialShares[$x]['tweetCount'] = $twitterResponse->count; } else{ $socialShares[$x]['tweetCount'] = 'unknown'; } echo '<td>'.$socialShares[$x]['tweetCount'].'</td>'; echo '</tr>'; } echo '</Table>'; makeCSV($socialShares,"shares.csv"); echo '<a href="shares.csv">Shares.csv</a>';
  28. @iPullRank
  29. @iPullRank
  30. @iPullRank
  31. @iPullRank
  32. @iPullRank
  33. @iPullRank
  34. @iPullRank
  35. @iPullRank
  36. @iPullRank
  37. @iPullRank
  38. @iPullRank
  39. @iPullRank
  40. @iPullRank
  41. @iPullRank
  42. @iPullRank
  43. X-Quota-Remaining <?php include_once“”;
  44. @iPullRank
  45. @iPullRank
  46. @iPullRank
  47. @iPullRank
  48. @iPullRank
  49. @iPullRank
  50. <?php include_once“”;
  51. @iPullRank
  52. @iPullRank
  53. @iPullRank
  54. @iPullRank
  55. @iPullRank
  56. @iPullRank
  57. @iPullRank
  58. THANK YOU ANY QUESTIONS?

×