Skip to content

Commit

Permalink
update css and js; footer; datatable style; reformat; pdn icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwright324 committed Dec 19, 2020
1 parent 0378864 commit 3e4a606
Show file tree
Hide file tree
Showing 16 changed files with 726 additions and 649 deletions.
22 changes: 17 additions & 5 deletions README.md
@@ -1,4 +1,5 @@
# YouTube Geofind

Search by channel, topic, and location for geotagged videos. View in map and export results.

* https://mattw.io/youtube-geofind/
Expand All @@ -12,27 +13,35 @@ What's unique about this tool? How can you use it?
- What livestreams are running now in my state/country? (find me, radius 500 or 1000, live events only)
2. Use it for investigative purposes, OSINT.
- Channel searching allows you to check all the uploads on a channel for geotags and displays them in a map.
- Topic searching allows you to check if any uploads found by regular searching or keywords have geotags (though, not many do).
- Topic searching allows you to check if any uploads found by regular searching or keywords have geotags (though,
not many do).
- Location searching allows you to find videos with geotags within your chosen radius and timeframe.
- Export results to save your findings and use elsewhere.
- Results can be directly opened in my new YouTube Metadata tool to give all details about that video and its author.
- Results can be directly opened in my new YouTube Metadata tool to give all details about that video and its
author.
3. Query API as noted below

## Query API
The tool provides a pseudo-api with query parameters that allow manipulation of the page elements so that you can share a search you made or implement a linked custom search from your own site/tool.

The tool provides a pseudo-api with query parameters that allow manipulation of the page elements so that you can share
a search you made or implement a linked custom search from your own site/tool.

### Channel page

The following parameter(s) will work with just the channel page `/youtube-geofind/`

| Parameter | Accepted values |
| :---: | :--- |
| channels | string, comma separated list of channel names or ids <br> e.g. <br>`UChirEOpgFCupRAk5etXqPaA` <br>`vicenews,UChirEOpgFCupRAk5etXqPaA,thesamlivecast` |

Example(s)

- https://mattw.io/youtube-geofind/?channels=GP4YOU&doSearch=true

### Location & Topic pages
The following parameter(s) are shared by both the location `/youtube-geofind/location` and topic `/youtube-geofind/topic` pages.

The following parameter(s) are shared by both the location `/youtube-geofind/location` and
topic `/youtube-geofind/topic` pages.

| Parameter | Accepted values |
| :---: | :--- |
Expand All @@ -49,9 +58,11 @@ The following parameter(s) are shared by both the location `/youtube-geofind/loc
| syndicated | boolean `true` or `false` |

Example(s)

- https://mattw.io/youtube-geofind/topic?keywords=hurricane&doSearch=true

### Location page

The following parameter(s) will work with just the location page `/youtube-geofind/location`

| Parameter | Accepted values |
Expand All @@ -61,14 +72,15 @@ The following parameter(s) will work with just the location page `/youtube-geofi
| radius | integer, may only be one of the specified values that show in the select box in the page. otherwise, the select box will become blank <br> One of these only: `1, 2, 5, 10, 15, 20, 50, 100, 200, 500, 1000` |

Example(s)

- https://mattw.io/youtube-geofind/location?location=43.054098,-79.2281175&radius=2&doSearch=true
- https://mattw.io/youtube-geofind/location?locationAddress=ohio&radius=1000&live=true&doSearch=true
- https://mattw.io/youtube-geofind/location?locationAddress=the%20white%20house&radius=15&timeframe=day-30&doSearch=true
- https://mattw.io/youtube-geofind/location?locationAddress=the%20white%20house&radius=15&timeframe=day-30&doSearch=true
- https://mattw.io/youtube-geofind/location?locationAddress=the%20white%20house&radius=15&timeframe=custom&start=2018-05-01&end=2018-05-14&doSearch=true


### All pages

This parameter is shared by all page types.

| Parameter | Accepted values |
Expand Down
3 changes: 2 additions & 1 deletion _config.yml
Expand Up @@ -4,7 +4,8 @@ exclude : [.idea]
title : YouTube Geofind
subtitle : Discover Geo-tagged Videos
author : mattwright324
copyright : © 2021 Matthew Wright
copyright : 2021
home : https://mattw.io/
github : https://github.com/mattwright324/
github_repo : https://github.com/mattwright324/youtube-geofind/
gh_pages : https://mattw.io/youtube-geofind/
80 changes: 42 additions & 38 deletions _includes/custom_apikey.html
@@ -1,40 +1,44 @@
<div class="form-group row" style="margin: 0 auto; text-align: center">
<span style="font-weight: bold; margin-right: 15px; margin-top: auto; margin-bottom: auto;">Quota errors?</span>
<input type="text" class="form-control" id="key" aria-describedby="help" style="max-width: 200px;"
placeholder="YouTube API Key" />
<button id="setButton" class="btn btn-info" disabled="disabled">Set</button>
<small id="msg" style="font-weight: bold; margin-left: 15px; margin-top: auto; margin-bottom: auto;" align=center>* Optional</small>
<br>
<script>
function getCookie(cn) {
var name = cn+"=";
var allCookie = decodeURIComponent(document.cookie).split(';');
var cval = [];
for(var i=0; i < allCookie.length; i++) {
if (allCookie[i].trim().indexOf(name) == 0) {
cval = allCookie[i].trim().split("=");
}
}
return (cval.length > 0) ? cval[1] : "";
}
let cookieKey = getCookie("apiKey");
if(cookieKey != undefined && cookieKey != "") {
GOOGLE_API_KEY = cookieKey;
}
$('#setButton').click(function() {
let newKey = $("#key").val();
if(newKey == "") {
$("#msg").text("unset");
GOOGLE_API_KEY = DEFAULT_KEY;
document.cookie = "apiKey=";
} else {
$("#msg").text("set");
document.cookie = "apiKey="+newKey;
GOOGLE_API_KEY = newKey;
}
});
$("#key").attr("value", cookieKey);
</script>
<span style="font-weight: bold; margin-right: 15px; margin-top: auto; margin-bottom: auto;">Quota errors?</span>
<input type="text" class="form-control" id="key" aria-describedby="help" style="max-width: 200px;"
placeholder="YouTube API Key"/>
<button id="setButton" class="btn btn-info" disabled="disabled">Set</button>
<small id="msg" style="font-weight: bold; margin-left: 15px; margin-top: auto; margin-bottom: auto;" align=center>*
Optional</small>
<br>
<script>
function getCookie(cn) {
var name = cn + "=";
var allCookie = decodeURIComponent(document.cookie).split(';');
var cval = [];
for (var i = 0; i < allCookie.length; i++) {
if (allCookie[i].trim().indexOf(name) == 0) {
cval = allCookie[i].trim().split("=");
}
}
return (cval.length > 0) ? cval[1] : "";
}

let cookieKey = getCookie("apiKey");
if (cookieKey != undefined && cookieKey != "") {
GOOGLE_API_KEY = cookieKey;
}
$('#setButton').click(function () {
let newKey = $("#key").val();
if (newKey == "") {
$("#msg").text("unset");
GOOGLE_API_KEY = DEFAULT_KEY;
document.cookie = "apiKey=";
} else {
$("#msg").text("set");
document.cookie = "apiKey=" + newKey;
GOOGLE_API_KEY = newKey;
}
});
$("#key").attr("value", cookieKey);
</script>
</div>
<small class="form-text text-muted" align=center>Here is the <a target="_blank" href="https://developers.google.com/youtube/v3/getting-started">guide to get your key</a>. Enable "YouTube Data API.". Set blank to use default.</small>
<br>
<small class="form-text text-muted" align=center>Here is the <a target="_blank"
href="https://developers.google.com/youtube/v3/getting-started">guide
to get your key</a>. Enable "YouTube Data API.". Set blank to use default.</small>
<br>
143 changes: 72 additions & 71 deletions _includes/form_controls.html
@@ -1,88 +1,89 @@
<!-- Shared form controls for location and topic search -->
<div class="form-group row">
<label class="col-2 col-form-label">Timeframe</label>
<div class="col-10" style="width: 100%">
<select id="timeframe" aria-describedby="orderhelp" class="custom-select">
<option value="any" selected>Any</option>
<option value="hour-1">Past hour</option>
<option value="hour-3">Past 3 hours</option>
<option value="hour-6">Past 6 hours</option>
<option value="hour-12">Past 12 hours</option>
<option value="hour-24">Past 24 hours</option>
<option value="day-7">Past 7 days</option>
<option value="day-30">Past 30 days</option>
<option value="day-90">Past 90 days</option>
<option value="day-365">Past year</option>
<option value="custom">Custom</option>
</select>
</div>
<label class="col-2 col-form-label">Timeframe</label>
<div class="col-10" style="width: 100%">
<select id="timeframe" aria-describedby="orderhelp" class="custom-select">
<option value="any" selected>Any</option>
<option value="hour-1">Past hour</option>
<option value="hour-3">Past 3 hours</option>
<option value="hour-6">Past 6 hours</option>
<option value="hour-12">Past 12 hours</option>
<option value="hour-24">Past 24 hours</option>
<option value="day-7">Past 7 days</option>
<option value="day-30">Past 30 days</option>
<option value="day-90">Past 90 days</option>
<option value="day-365">Past year</option>
<option value="custom">Custom</option>
</select>
</div>
</div>
<div id="customRange" style="display:none;">
<div class="form-group row">
<label class="col-2 col-form-label"><i>Date From</i></label>
<div class="col-10">
<input class="form-control" style="max-width: 200px;" id="dateFrom" type="date" value="2005-02-13">
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label" ><i>Date To</i></label>
<div class="col-10">
<input class="form-control" style="max-width: 200px;" id="dateTo" type="date">
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label"><i>Date From</i></label>
<div class="col-10">
<input class="form-control" style="max-width: 200px;" id="dateFrom" type="date" value="2005-02-13">
</div>
</div>
<div class="form-group row">
<label class="col-2 col-form-label"><i>Date To</i></label>
<div class="col-10">
<input class="form-control" style="max-width: 200px;" id="dateTo" type="date">
</div>
</div>
</div>

<div class="form-group row">
<label class="col-2 col-form-label"><b>Page limit</b></label>
<div class="col-10" style="width: 100%">
<select id="pageLimit" aria-describedby="page-msg" class="custom-select">
<option value="1">1 page</option>
<option value="2">2 pages</option>
<option value="3" selected>3 pages</option>
<option value="5">5 pages</option>
<option value="7">7 pages</option>
<option value="15">All pages (up to 15)</option>
</select>
<small id="page-msg" class="form-text text-muted">
* API limits stop returning results around pages 10 to 13.
<br>
* Pages are set to return maximum of 50 results per page.
</small>
</div>
<label class="col-2 col-form-label"><b>Page limit</b></label>
<div class="col-10" style="width: 100%">
<select id="pageLimit" aria-describedby="page-msg" class="custom-select">
<option value="1">1 page</option>
<option value="2">2 pages</option>
<option value="3" selected>3 pages</option>
<option value="5">5 pages</option>
<option value="7">7 pages</option>
<option value="15">All pages (up to 15)</option>
</select>
<small id="page-msg" class="form-text text-muted">
* API limits stop returning results around pages 10 to 13.
<br>
* Pages are set to return maximum of 50 results per page.
</small>
</div>
</div>

<button class="btn btn-outline-secondary" id="btnToggleAdvanced">
Toggle Advanced Options
Toggle Advanced Options
</button>
<div id="advanced-form" style="display: none">
<div class="row">
<legend class="col-2 col-form-label">Options</legend>
<div class="row">
<legend class="col-2 col-form-label">Options</legend>

<div class="col-sm-10">
<div id="live-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="liveOnly">
<label class="custom-control-label" for="liveOnly">Live events only</label>
</div>
<div class="col-sm-10">
<div id="live-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="liveOnly">
<label class="custom-control-label" for="liveOnly">Live events only</label>
</div>

<div id="creative-commons" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="creativeCommons">
<label class="custom-control-label" for="creativeCommons">Licensed with Creative Commons</label>
</div>
<div id="creative-commons" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="creativeCommons">
<label class="custom-control-label" for="creativeCommons">Licensed with Creative Commons</label>
</div>

<div id="hd-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="highQuality">
<label class="custom-control-label" for="highQuality">High Quality only</label>
</div>
<div id="hd-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="highQuality">
<label class="custom-control-label" for="highQuality">High Quality only</label>
</div>

<div id="embedded-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="embeddedOnly">
<label class="custom-control-label" for="embeddedOnly">Can be embedded on other sites.</label>
</div>
<div id="embedded-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="embeddedOnly">
<label class="custom-control-label" for="embeddedOnly">Can be embedded on other sites.</label>
</div>

<div id="syndicated-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="syndicatedOnly">
<label class="custom-control-label" for="syndicatedOnly">Syndicated (Can be played outside youtube.com)</label>
</div>
</div>
</div>
</div>
<div id="syndicated-only" class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="syndicatedOnly">
<label class="custom-control-label" for="syndicatedOnly">Syndicated (Can be played outside
youtube.com)</label>
</div>
</div>
</div>
</div>
19 changes: 7 additions & 12 deletions _includes/head.html
Expand Up @@ -7,20 +7,15 @@
<link rel="stylesheet" href="./css/youtube-geofind.css?v={{ site.time | date_to_xmlschema }}"/>
<link rel="stylesheet" href="./css/spinner.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.23/datatables.min.css"/>

<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://rawgit.com/peteboere/1517285/raw/a74937246b910f3e84f7a5ae072375cdaf040c2b/jquery.alterclass.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.23/datatables.min.js"></script>

<script src="./js/youtube-api-v3.js?v={{ site.time | date_to_xmlschema }}" type="text/javascript"></script>
<script src="./js/youtube-geofind-v4.js?v={{ site.time | date_to_xmlschema }}" type="text/javascript"></script>
Expand Down

0 comments on commit 3e4a606

Please sign in to comment.