Ejemplo n.º 1
0
function download() {
	if(isset($_POST) && isset($_POST['id'])) {
		if(zipit(getcwd().'/../content/'.$_POST['id'], getcwd().'/../content/'.$_POST['id']."/".$_POST['id'].'.zip', "html_part.html")) {
			return '/../content/'.$_POST['id']."/".$_POST['id'].'.zip';
		}
	}
	return false;
}
file_put_contents($filename . "_users.tab", $tab_users);
// create media TAB output
if ($getuserinfo) {
    foreach ($media as $medium) {
        $media[$medium["id"]] = array_merge($media[$medium["id"]], $users[$medium["user_id"]]);
    }
}
$tab_media = implode("\t", array_keys($media[array_shift(array_keys($media))])) . "\n";
foreach ($media as $medium) {
    $tab_media .= implode("\t", $medium) . "\n";
}
file_put_contents($filename . "_media.tab", $tab_media);
// HTML output
echo '<p>The script has extracted tags from ' . $stats["counter"] . ' media items that were posted between ' . date("Y-m-d H:i:s", $stats["oldest"]) . ' and ' . date("Y-m-d H:i:s", $stats["newest"]) . '.</p>';
$files = array($filename . "_tagnet.gdf", $filename . "_media.tab", $filename . "_users.tab");
zipit($filename, $files);
echo 'NB: Instagram also retrieves media items that once were, but not longer are tagged with the requested term. The date range indicates when media items were posted, but Instagram retrieves media items ordered according to when they were tagged.<br /><br />';
// HTML data table
if ($showimages) {
    //print_r($media);
    echo '<table>';
    echo '<tr>';
    foreach (array_keys($media[array_shift(array_keys($media))]) as $title) {
        echo '<th>' . $title . '</th>';
    }
    echo '</tr>';
    foreach ($media as $medium) {
        echo '<tr>';
        foreach ($medium as $element) {
            if (preg_match("/\\.jpg/", $element)) {
                echo '<td><div><img src="' . $element . '" /></div></td>';
Ejemplo n.º 3
0
    foreach ($nodes as $key => $node) {
        if ($anon) {
            $name = sha1($key);
            $label = preg_match("/post_/", $node["type"]) ? $node["label"] : "user_" . $key;
        } else {
            $name = $key;
            $label = $node["label"];
        }
        $label = preg_replace("/\t/", " ", $label);
        $post_id = preg_match("/post_/", $node["type"]) ? $key : "";
        $content .= $name . "," . $label . "," . $node["type"] . "," . $node["type_post"] . "," . $node["created_time"] . "," . $node["created_time_unix"] . "," . $node["locale"] . "," . $node["sex"] . "," . $node["likes"] . "," . $node["likes_count_fb"] . "," . $node["comments_all"] . "," . $node["comments_base"] . "," . $node["comments_replies"] . "," . $node["comment_likes"] . "," . $node["shares"] . "," . $node["engagement"] . "," . $post_id . "," . $node["post_link"] . "\n";
        $nodecounter++;
    }
    $content .= "edgedef>node1 VARCHAR,node2 VARCHAR,weight INT";
    unset($nodes);
    $content .= file_get_contents($filename_tmp_edges);
    file_put_contents($filename, $content, FILE_APPEND);
    //file_put_contents($filename_tsv, $tsv); 						moved to streamed writing
    //file_put_contents($filename_comments_tsv, $comments_tsv);
    echo '<h2>download</h2>';
    echo '<p>extracted data from ' . $pcount . ' posts, with ' . ($nodecounter - $pcount) . ' users liking or commenting ' . $edgecounter . ' times</p>';
    $files = array($filename, $filename_tsv, $filename_comments_tsv, $filename_country_tsv);
    zipit($fn, $files);
    logit($filename, $clientip, count($friendnames));
    /*
    echo '<p>Your <a href="'.$filename.'">gdf file</a> (right click, save as...).</p>';
    echo '<p>Your <a href="'.$filename_tsv.'">tsv stat file</a> (right click, save as...).</p>';
    echo '<p>Your <a href="'.$filename_comments_tsv.'">tsv comments file</a> (right click, save as...).</p>';
    echo '<p><b>Attention: some browsers add a .txt extension to the files, which must be removed after saving. When in doubt, use Firefox.</b></p>';
    */
}