From 2af4ffce19df7cdb34d4b509a66bc916ffcb88d1 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 3 Feb 2020 09:47:21 +0100 Subject: Initial commit --- fetch.php | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 fetch.php (limited to 'fetch.php') diff --git a/fetch.php b/fetch.php new file mode 100644 index 0000000..1adccc6 --- /dev/null +++ b/fetch.php @@ -0,0 +1,96 @@ + + + + Fetching new events + + + +
+ + + + + + + + $msg['guessed_source']]); + $info=$parsed['info']; + $selected=count ($parsed['warnings'])==0; + + foreach ($info['keywords'] as $i => $keyword){ + $id=get_keyword ($keyword); + if (is_null ($id)){ + $info['keywords'][$i]=''.htmlspecialchars ($keyword).''; + $selected=false; + } else + $info['keywords'][$i]=htmlspecialchars ($keyword); + } + + $id=get_source ($info['source']); + if (is_null ($id)){ + $info['source']=''.htmlspecialchars ($info['source']).''; + $selected=false; + } else + $info['source']=htmlspecialchars ($info['source']); + + echo ''; + + $checked=$selected ? 'checked="checked"' : ''; + echo ''; + + echo ''; + + $description=nl2br (htmlspecialchars ($info['description'])); + echo ''; + + echo ''; + + echo ''; + } catch (Exception $e){ + $exceptions[]=$e->getMessage(); + } +} + +echo '
SelectInfoDescriptionWarnings
'; + echo htmlspecialchars ($info['title']).'
'; + echo htmlspecialchars ($info['location']).'
'; + if ($info['start_date']==$info['end_date']) + echo $info['start_date'].'
'; + else + echo $info['start_date'].' to '.$info['end_date'].'
'; + echo implode (', ',$info['keywords']).'
'; + echo $info['source']; + echo '
'.$description.''; + if (count ($parsed['warnings'])==0) + echo '—'; + else + foreach ($parsed['warnings'] as $warning) + echo htmlspecialchars ($warning).'
'; + echo '
'; + +if (count ($exceptions)>0){ + echo 'Exceptions:
'; + foreach ($exceptions as $e) + echo $e.'
'; +} + +mail_finish(); + +if (count ($messages)>0) + echo ''; +else + echo 'No new events found.'; +?> +
+ + -- cgit v1.2.3