Successfully reported this slideshow.
Upcoming SlideShare
×

Mike King - Storytelling by Numbers MKTFEST 2014

3,801 views

Published on

Get videos from all our lectures - http://video.marketingfestival.cz

Marketing Festival - World-Class Digital Marketing Event #mktfest Czech Republic

Published in: Data & Analytics, Business
• Full Name
Comment goes here.

Are you sure you want to Yes No

Mike King - Storytelling by Numbers MKTFEST 2014

1. 1. @iPullRank
2. 2. @iPullRank
3. 3. @iPullRank
4. 4. @iPullRank
5. 5. @iPullRank
6. 6. @iPullRank
7. 7. @iPullRank
8. 8. <?php ?>
9. 9. // This is a comment /* This is also a comment on multiple lines*/
10. 10. \$a = 5;
11. 11. + – / *
12. 12. \$f = ‘marketing’ . ’festival’; // Sets the value of \$f to “marketingfestival”
13. 13. if ( condition ) { do things } elseif( condition) { do other things } else{ do other things }
14. 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. 15. while foreach for (initial value of counter; loop ending condition; counter increment or decrement) { do things }
16. 16. \$count = 40; For (\$x=1;\$x<(\$count+1);\$x++) { echo \$x . “<Br/>”; }
17. 17. \$count = 40; For (\$x=1;\$x<\$count;\$x++) { for (\$y=0;\$y<10;\$y++) { echo \$x+\$y . “<Br/>”; } }
18. 18. \$variable[0] = “this is first element of an array”; \$variable[1] = “this is second element of an array”;
19. 19. \$variable[“element”] = “this is first associative element of an array”; \$variable[“second”] = “this is second associative element of an array”;
20. 20. \$variable[“element”][“score”]= 80; \$variable[“second”][5] = “this is the 6 element within the second element”;
21. 21. <?php include_once“csv-handlers.php”; \$csv = csv_to_array(“insert file name here.csv”);
22. 22. <?php include_once“csv-handlers.php”; \$csv = csv_to_array(“example.csv”); print_r(\$csv);
23. 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. 24. if(\$response->info->http_code== 200) { \$twitterResponse= \$response->decode_response(); echo 'tweet count is ' .\$twitterResponse->count; }
25. 25. <?php include_once“csv-handlers.php”; makeCSV(\$csv, “test.csv”);
26. 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. 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. 28. @iPullRank
29. 29. @iPullRank
30. 30. @iPullRank
31. 31. @iPullRank
32. 32. @iPullRank
33. 33. @iPullRank
34. 34. @iPullRank
35. 35. @iPullRank
36. 36. @iPullRank
37. 37. @iPullRank
38. 38. @iPullRank
39. 39. @iPullRank
40. 40. @iPullRank
41. 41. @iPullRank
42. 42. @iPullRank
43. 43. X-Quota-Remaining <?php include_once“”;
44. 44. @iPullRank
45. 45. @iPullRank
46. 46. @iPullRank
47. 47. @iPullRank
48. 48. @iPullRank
49. 49. @iPullRank
50. 50. <?php include_once“”;
51. 51. @iPullRank
52. 52. @iPullRank
53. 53. @iPullRank
54. 54. @iPullRank
55. 55. @iPullRank
56. 56. @iPullRank
57. 57. @iPullRank
58. 58. THANK YOU ANY QUESTIONS?