more scrapers
[disclosr.git] / documents / viewDocument.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
 
include_once('../include/common.inc.php');
$hash = $_REQUEST['hash'];
$docsdb = $server->get_db('disclosr-documents');
$doc = object_to_array($docsdb->get($hash));
 
if (!isset($doc['_attachments']) || count($doc['_attachments']) == 0) die ("no attachments");
$attachments = $doc['_attachments'];
$attachment_filenames = array_keys($attachments);
//print_r($attachments);
$url = $serverAddr.'disclosr-documents/'.$hash.'/'.urlencode($attachment_filenames[0]);
//echo $url;
$request = Requests::get($url);
echo ($request->body);