Commit 51256dce authored by Siltaar's avatar Siltaar

Add Feedback link in footer ; keep search terms when using Cancel button ; Add France Inter source

parent 942850cb
......@@ -266,15 +266,18 @@
over <span id="mp_src_fetched"></span> selected.
</p>
<p>
Available: <span id="mp_loaded_source_total"></span> source(s)
loaded in <span id="mp_loaded_source_duration"></span>s
Sources: <span id="mp_loaded_source_total"></span>
(loaded in <span id="mp_loaded_source_duration"></span>s)
for <span id="mp_loaded_source_countries"></span> countries
and <span id="mp_loaded_source_langs"></span> languages.
</p>
<p>
Meta-Press.es v1.3.1, WebExtension made by <a target="_blank" href="https://acoeuro.com" title="Libres Software Service Society">Acoeuro.com</a> with <a target="_blank" href="https://listjs.com/" title="Adding search, sort, filters and flexibility to various existing HTML element collections.">List.js</a>, <a target="_blank" href="https://github.com/Mobius1/Selectr/wiki" title="A lightweight, vanilla javascript select box replacement. No dependencies.">Selectr</a> and <a href="https://getbootstrap.com/">Bootstrap</a>.
<a href="#" id="scroll_top">Back to top</a> &nbsp;
<a href="https://framagit.org/Siltaar/meta-press-ext/issues">Report feedback</a>
</p>
<p>
<a href="https://www.meta-press.es">Meta-Press.es</a> v1.3.1 WebExtension made by <a target="_blank" href="https://acoeuro.com" title="Libres Software Service Society">Acoeuro.com</a> with <a target="_blank" href="https://listjs.com/" title="Adding search, sort, filters and flexibility to various existing HTML element collections.">List.js</a>, <a target="_blank" href="https://github.com/Mobius1/Selectr/wiki" title="A lightweight, vanilla javascript select box replacement. No dependencies.">Selectr</a> and <a href="https://getbootstrap.com/">Bootstrap</a>.<br/>
</p>
<p><a href="#" id="scroll_top">Back to top</a></p>
</footer>
</body>
<script src="js/list.min.js" type="text/javascript"></script>
......
......@@ -55,6 +55,7 @@ import * as µ from "/js/utils.js"
query_final_result_timeout: null,
query_start_date: null,
}
document.getElementById("mp_query").value = new URL(window.location).searchParams.get('q')
document.getElementById("mp_query").addEventListener("keypress", function(evt) {
if (!evt) evt = window.event
var keyCode = evt.keyCode || evt.which
......@@ -270,7 +271,10 @@ import * as µ from "/js/utils.js"
document.getElementById("mp_stop").addEventListener("click", () => {
// cancel running promises -> impossible in 2019
// clear_results()
location.reload()
// location.reload()
let new_url = new URL(location).searchParams.set('q',
document.getElementById("mp_query").value)
window.location = new_url.href
})
document.getElementById("mp_headlines_page_5").addEventListener("click", () => {
headlineList.show(0, 5); HEADLINE_PAGE_SIZE=5})
......@@ -575,7 +579,7 @@ import * as µ from "/js/utils.js"
}
function parse_dt_str(dt_str, tz) {
var d = undefined
if (/\d{13,20}/i.test(dt_str)) {
if (/\d{12,20}/i.test(dt_str)) {
d = new Date(Number(dt_str))
} else if (/min(utes?)?( ago)?/i.test(dt_str)) {
d = µ.timezoned_date("", tz)
......@@ -673,14 +677,19 @@ import * as µ from "/js/utils.js"
} else {
try {
val = µ.triw(val.textContent)
} catch (exc) { console.error(src.tags.name, elt, exc, dom)
val = ""
} catch (exc) {
console.error(src.tags.name, elt, exc, dom)
if (elt == 'r_dt') {
val = "100000000000" // an old date Sat Mar 03 1973 09:46:40 GMT+0000
} else {
val = ""
}
}
}
}
// if (elt == 'r_dt') console.log('before', val)
var elt_re = src[`${elt}_re`]
if (typeof (elt_re) == "object") { // because it should be a list of 2 elements
var elt_re = src[`${elt}_re`] // it should be a list of 2 elements
if (typeof (elt_re) == "object" && typeof (val) == "string") {
val = µ.regextract(elt_re[0], val, elt_re[1])
}
// if (elt == 'r_dt') console.log('after', val)
......
......@@ -2274,7 +2274,7 @@
"lang": "fr",
"country": "fr",
"themes": ["general"],
"tech": ["own search", "OR", "fast"],
"tech": ["broken", "own search", "OR", "fast"],
"internal": "more results",
"src_type": ["press", "radio"],
"res_type": "text",
......@@ -2486,7 +2486,7 @@
"themes": ["general"],
"tech": ["own search", "AND", "fast"],
"src_type": "TV",
"res_type": "text",
"res_type": ["text", "video"],
"scope": "National",
"freq": "weekly"
}
......@@ -2766,8 +2766,8 @@
"freq": "daily"
}
},
"https://www.ledauphine.com/": {
"headline_url": "https://www.ledauphine.com/",
"https://www.ledauphine.com": {
"headline_url": "https://www.ledauphine.com",
"headline_selector": "article.primary a",
"search_url": "https://www.ledauphine.com/recherche?q={}",
"results": "div.contentList article",
......@@ -2793,7 +2793,7 @@
},
"https://www.laprovence.com": {
"type": "JSON",
"headline_url": "https://www.laprovence.com/",
"headline_url": "https://www.laprovence.com",
"headline_selector": "h2.slide-content__title a",
"search_url": "https://www.laprovence.com/async/search/{}/0/0/12",
"favicon_url": "https://www.laprovence.com/statics/images/favicon.png",
......@@ -2816,8 +2816,8 @@
},
"positive_test_search_term": "gilets jaunes"
},
"https://www.francebleu.fr/": {
"headline_url": "https://www.francebleu.fr/",
"https://www.francebleu.fr": {
"headline_url": "https://www.francebleu.fr",
"headline_selector": "div.rfb-home-a-la-une div.rfb-highlight-card-container a",
"search_url": "https://www.francebleu.fr/recherche?q={+}",
"results": "div.rfb-highlight-card-content",
......@@ -2835,12 +2835,38 @@
"themes": ["general"],
"tech": ["OR", "own search", "fast"],
"src_type": "radio",
"res_type": "text",
"res_type": ["text", "podcast"],
"scope": "National",
"freq": "daily"
},
"positive_test_search_term": "retraites manifestations"
},
"https://www.franceinter.fr": {
"headline_url": "https://www.franceinter.fr",
"headline_selector": "div.aNePasManquer-content div.card:first-of-type div.card-text a.card-text-sub",
"search_url": "https://www.franceinter.fr/recherche?q={}",
"results": "article.rich-section-list-item",
"r_h1": "a.rich-section-list-item-content-title",
"r_url": "a.rich-section-list-item-content-title",
"r_url_attr": "href",
"r_txt": "a.rich-section-list-item-content-title",
"r_by": "span.rich-section-list-item-content-infos-author a",
"r_dt": "span.rich-section-list-item-content-infos-date",
"r_dt_re": ["(\\d{2})\\s+(\\w+.)\\s+(\\d{4})", "$3-{$2}-$1"],
"tags":{
"name": "France Inter",
"lang": "fr",
"country": "fr",
"tz": "Europe/Paris",
"themes": ["general"],
"tech": ["AND", "own search", "fast"],
"src_type": "radio",
"res_type": ["text", "podcast"],
"scope": "National",
"freq": "daily"
},
"positive_test_search_term": "retraites"
},
"RSS": {
"filters": "category",
"results": "item",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment