forked from digitalmethodsinitiative/dmi-tcat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REST API for purging tweets (digitalmethodsinitiative#205)
REST API for purging tweets, thanks to @hoylen
- Loading branch information
Showing
9 changed files
with
1,857 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* TCAT API */ | ||
|
||
/* COMMON */ | ||
|
||
body { | ||
font-family: sans-serif; | ||
font-size: 12px; | ||
} | ||
|
||
h1 { | ||
float: left; | ||
margin: 0; | ||
padding: 1em 0 1ex 0; | ||
|
||
font-size: 150%; | ||
} | ||
h2 { font-size: 130%; } | ||
h3 { font-size: 115%; } | ||
|
||
|
||
|
||
/* ids */ | ||
|
||
#content { | ||
max-width: 1000px; | ||
padding: 1ex 0 1ex 0; | ||
} | ||
|
||
/* Top links */ | ||
|
||
#if_links { | ||
float: right; | ||
margin: 2ex 0 1ex 0; | ||
} | ||
|
||
#if_links a { | ||
display: inline-block; | ||
margin-left: 1em; | ||
text-decoration: none; | ||
color: #000; | ||
} | ||
#if_links a:before { content: "» "; } | ||
#if_links a:hover { text-decoration: underline; } | ||
|
||
/* Breadcrumb navigation */ | ||
|
||
ul.breadcrumbs { | ||
display: block; | ||
clear: both; | ||
margin: 0; | ||
padding: 1ex 0 1ex 0; | ||
} | ||
|
||
ul.breadcrumbs > li { | ||
display: inline-block; | ||
color: #999; | ||
} | ||
ul.breadcrumbs > li:first-child:before { content: ""; } | ||
ul.breadcrumbs > li:before { content: " » "; } | ||
|
||
ul.breadcrumbs > li > a { | ||
display: inline-block; | ||
color: #999; | ||
text-decoration: none; | ||
} | ||
ul.breadcrumbs > li > a:hover { | ||
color: #000; | ||
text-decoration: underline; | ||
} | ||
|
||
/* Main contents of page */ | ||
|
||
div#content { clear: both; } | ||
|
||
/* Tables */ | ||
|
||
table { | ||
border-collapse: collapse; | ||
} | ||
th { | ||
padding-right: 0.5em; | ||
text-align: right; | ||
} | ||
th:after { | ||
content: ":"; | ||
} | ||
td { padding: 0.5ex; } | ||
|
||
/* SPECIFIC */ | ||
|
||
/* Text input fields on querybin tweet view page */ | ||
|
||
input#startdate, input#enddate { | ||
min-width: 16em; /* to accommodate "YYYY-MM-DD HH:MM:SS +hh:mm" */ | ||
} | ||
#export-tweets-form { | ||
float: left; | ||
margin-top: 2ex; | ||
} | ||
#purge-tweets-form { | ||
float: right; | ||
margin-top: 2ex; | ||
text-align: center; | ||
} | ||
|
||
#purge-time-warning { | ||
clear: both; | ||
padding: 1ex 0; | ||
text-align: right; | ||
color: #666; | ||
} | ||
/* EOF */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
require_once __DIR__ . '/lib/common.php'; | ||
require_once __DIR__ . '/lib/http_util.php'; | ||
|
||
switch (choose_mediatype(['text/html'])) { | ||
case 'text/html': | ||
html_begin("API", []); | ||
echo <<<END | ||
<ul> | ||
<li><a href="querybin.php">List query bins</a></li> | ||
</ul> | ||
END; | ||
echo "<p>Version: ", API_VERSION, "</p>\n"; | ||
html_end(); | ||
break; | ||
default: | ||
echo "DMI-TCAT API (version: ", API_VERSION, ")\n"; | ||
echo " Running this script from the command line does nothing useful!\n"; | ||
echo " Run \"php querybin.php --help\" instead.\n"; | ||
exit(1); | ||
break; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
// Common code that is loaded by all the API PHP scripts. | ||
|
||
define('API_VERSION', '1.0'); | ||
|
||
// Speed multiplier for estimating purge times. | ||
// | ||
// Set this to a number greater than 1.0 for slower machines. | ||
// Set this to a number less than 1.0 for faster machines. | ||
|
||
define('PURGE_TIME_FACTOR', 1.0); | ||
|
||
// Default timezone | ||
// | ||
// Set this to a string indicating the timezone to use for displaying | ||
// times and for parsing strings (when no explicit timezone is in the | ||
// string). | ||
// | ||
// Valid values can be found at: <http://php.net/manual/timezones.php> | ||
// | ||
// Strings of the form "+HH:MM" DO NOT WORK correctly. if you must | ||
// specify an offset, try the values under the "Other" section of the | ||
// above page. Note: those values are incomplete and the sign is | ||
// reversed (e.g. for UTC+10, the name is "Etc/GMT-10"). PHP! | ||
// | ||
// If not set (or set to NULL), times will be displayed in UTC and strings | ||
// being parsed must explicitly include a timezone. | ||
// | ||
// Examples: | ||
// $api_timezone = date_default_timezone_get(); // PHP's default | ||
// $api_timezone = 'UTC'; | ||
// $api_timezone = 'Europe/Amsterdam'; | ||
// $api_timezone = 'Australia/Brisbane'; | ||
|
||
$api_timezone = NULL; | ||
|
Oops, something went wrong.