SlideShare a Scribd company logo
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
@iPullRank
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
Storytelling By Numbers
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
<?php 
?>
// This is a comment 
/* This is also a comment 
on multiple lines*/
$a = 5;
+ – / *
Storytelling By Numbers
$f = ‘marketing’ . ’festival’; 
// Sets the value of $f to “marketingfestival”
if ( condition ) 
{ 
do things 
} 
elseif( condition) 
{ 
do other things 
} 
else{ 
do other things 
}
$a = 50; 
if($a ==49) 
{ 
echo “a is 49”; 
} 
elseif($a == 52) 
{ 
echo “a is 52”; 
} 
else{ 
echo “a is not a known number”; 
}
while foreach 
for (initial value of counter; loop ending condition; counter increment or decrement) 
{ 
do things 
}
$count = 40; 
For ($x=1;$x<($count+1);$x++) 
{ 
echo $x . “<Br/>”; 
}
$count = 40; 
For ($x=1;$x<$count;$x++) 
{ 
for ($y=0;$y<10;$y++) 
{ 
echo $x+$y . “<Br/>”; 
} 
}
$variable[0] = “this is first element of an array”; 
$variable[1] = “this is second element of an array”;
$variable[“element”] = “this is first associative element of an array”; 
$variable[“second”] = “this is second associative element of an array”;
$variable[“element”][“score”]= 80; 
$variable[“second”][5] = “this is the 6 element within the second element”;
Storytelling By Numbers
<?php 
include_once“csv-handlers.php”; 
$csv = csv_to_array(“insert file name here.csv”);
<?php 
include_once“csv-handlers.php”; 
$csv = csv_to_array(“example.csv”); 
print_r($csv);
<?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"));
if($response->info->http_code== 200) 
{ 
$twitterResponse= $response->decode_response(); 
echo 'tweet count is ' .$twitterResponse->count; 
}
<?php 
include_once“csv-handlers.php”; 
makeCSV($csv, “test.csv”);
<?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>';
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>';
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
@iPullRank
Storytelling By Numbers
@iPullRank
Storytelling By Numbers
@iPullRank
@iPullRank
Storytelling By Numbers
@iPullRank
@iPullRank
@iPullRank
@iPullRank
@iPullRank
@iPullRank
@iPullRank
@iPullRank
@iPullRank
@iPullRank
X-Quota-Remaining 
<?php 
include_once“”;
@iPullRank
@iPullRank
@iPullRank
@iPullRank
@iPullRank
Storytelling By Numbers
@iPullRank
<?php 
include_once“”;
@iPullRank
Storytelling By Numbers
@iPullRank
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
@iPullRank
Storytelling By Numbers
Storytelling By Numbers
Storytelling By Numbers
THANK YOU 
ANY QUESTIONS?

More Related Content

Storytelling By Numbers