<commit_before>#!/usr/bin/php
<?php

$projects = array(
	'Fair Vote Canada'		=> 'https://www.indiegogo.com/projects/make-2015-the-last-unfair-election',
);



foreach($projects as $projectName => $url) {

$html = file_get_contents($url);

$doc = new DOMDocument();
$previous_value = libxml_use_internal_errors(TRUE);
$doc->loadHTML($html);
libxml_clear_errors();
libxml_use_internal_errors($previous_value);
$xpath = new DOMXPath($doc);

$amount 		= trim($xpath->query('/html/body/div[4]/div[4]/div[2]/div/div/div/span/span')->item(0)->textContent);
$percentRaised	= trim($xpath->query('/html/body/div[4]/div[4]/div[2]/div/div/div[4]/div')->item(0)->textContent);
$daysLeft 		= trim($xpath->query('/html/body/div[4]/div[4]/div[2]/div/div/div[4]/div[2]/span[2]')->item(0)->textContent);


echo "$projectName: $daysLeft days left - $percentRaised ($amount) \n";

}

<commit_msg>added no output if information can't be fetched<commit_after>#!/usr/bin/php
<?php

$projects = array(
	'Fair Vote Canada'		=> 'https://www.indiegogo.com/projects/make-2015-the-last-unfair-election',
);



foreach($projects as $projectName => $url) {

$html = file_get_contents($url);

$doc = new DOMDocument();
$previous_value = libxml_use_internal_errors(TRUE);
$doc->loadHTML($html);
libxml_clear_errors();
libxml_use_internal_errors($previous_value);
$xpath = new DOMXPath($doc);

if(is_object($xpath->query('/html/body/div[4]/div[4]/div[2]/div/div/div/span/span')->item(0))) {
	$amount 		= trim($xpath->query('/html/body/div[4]/div[4]/div[2]/div/div/div/span/span')->item(0)->textContent);
	$percentRaised	= trim($xpath->query('/html/body/div[4]/div[4]/div[2]/div/div/div[4]/div')->item(0)->textContent);
	$daysLeft 		= trim($xpath->query('/html/body/div[4]/div[4]/div[2]/div/div/div[4]/div[2]/span[2]')->item(0)->textContent);

	echo "$projectName: $daysLeft days left - $percentRaised ($amount) \n";
}



}


{'fraction_non_alphanumeric': 0.22962962962962963, 'fraction_numerical': 0.02328042328042328, 'mean_word_length': 5.802158273381295, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3337412', 'n_tokens_mistral': 759, 'n_tokens_neox': 726, 'n_words': 86}