Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
meta-press-ext
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
23
Issues
23
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siltaar
meta-press-ext
Commits
2fb3671f
Commit
2fb3671f
authored
Dec 03, 2019
by
Siltaar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- re-improve responsive design
parent
d034d15f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
65 deletions
+61
-65
css/meta-press.css
css/meta-press.css
+10
-31
index.html
index.html
+28
-15
js/meta-press.js
js/meta-press.js
+16
-13
js/sources.json
js/sources.json
+4
-4
js/utils.js
js/utils.js
+2
-1
manifest.json
manifest.json
+1
-1
No files found.
css/meta-press.css
View file @
2fb3671f
...
...
@@ -4,10 +4,6 @@
* licence: GPLv3
*/
/*
* Globals
*/
/* latin & latin-ext */
/* @font-face {
font-family: 'Amatic SC';
...
...
@@ -56,7 +52,10 @@ p, ul { margin-top:0 }
-webkit-box-shadow
:
inset
0
-2px
5px
rgba
(
0
,
0
,
0
,
.1
);
box-shadow
:
inset
0
-2px
5px
rgba
(
0
,
0
,
0
,
.1
);
}
#meta_press_logo
{
/* width:256px;
margin-right:1em; */
}
/** Nav links * */
.blog-nav-item
{
position
:
relative
;
...
...
@@ -91,42 +90,27 @@ p, ul { margin-top:0 }
content
:
" "
;
border-right
:
5px
solid
transparent
;
border-bottom
:
5px
solid
;
border-left
:
5px
solid
transparent
;
}
/** Blog name and description **/
#meta_press_logo
{
background
:
url(../img/logo-metapress-256px-bg.png)
;
display
:
block
;
float
:
left
;
width
:
256px
;
height
:
256px
;
margin-right
:
2em
;
}
#headlines
{
max-height
:
256px
;
overflow
:
hidden
;
border-left
:
5px
solid
transparent
;
}
/** Blog name and description **/
#headlines
.pagination
{
margin-left
:
16%
;
clear
:
both
;
}
.blog-title
{
margin-bottom
:
-0.4ex
;
font-size
:
108
px
;
font-size
:
89
px
;
font-weight
:
bold
;
padding-left
:
60px
;
}
.blog-description
{
font-size
:
41.5
px
;
font-size
:
34
px
;
color
:
#999
;
padding-left
:
60px
;
font-family
:
'Amatic SC'
,
cursive
;
margin-bottom
:
0.25ex
;
}
#headlines
ul
{
float
:
left
;
width
:
66%
;
padding
:
0
;
max-width
:
100%
;
}
/** Main column and sidebar layout **/
.blog-main
{
...
...
@@ -136,7 +120,6 @@ p, ul { margin-top:0 }
/* Sidebar modules for boxing content */
.sidebar-module
{
padding
:
15px
;
/*margin: 0 -15px 15px;*/
}
.sidebar-module-inset
{
padding
:
15px
;
...
...
@@ -212,7 +195,6 @@ p, ul { margin-top:0 }
background-color
:
#F0F0F0
;
border
:
none
;
height
:
5ex
;
/*margin-left:19ex;*/
}
#mp_submit
{
background-color
:
#00D0C0
;
...
...
@@ -293,7 +275,6 @@ p, ul { margin-top:0 }
-webkit-transform
:
scale
(
2
);
/* Safari and Chrome */
-o-transform
:
scale
(
2
);
/* Opera */
margin-left
:
1ex
;
/* margin-right:1ex; */
}
.f_icon
{
}
...
...
@@ -344,6 +325,7 @@ p, ul { margin-top:0 }
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
width
:
100%
;
}
.src_name_overflow
{
width
:
64%
;
...
...
@@ -355,9 +337,6 @@ p, ul { margin-top:0 }
direction
:
rtl
;
text-align
:
right
;
}
.header-inner
{
width
:
100%
;
}
.mf_dt_lbl
{
float
:
left
;
width
:
46%
;
...
...
index.html
View file @
2fb3671f
...
...
@@ -29,21 +29,34 @@
</div>
<div
class=
"container"
>
<div
class=
"blog-header"
>
<div
id=
"headlines"
class=
"col-sm-12"
>
<div
id=
"meta_press_logo"
title=
"Meta-Press.es logo by Elisa de Castro Guerra"
></div>
<h1
class=
"blog-title"
>
Meta-Press.es
</h1>
<p
class=
"lead blog-description"
>
Decentralized press meta-search engine
</p>
<ul
class=
"list"
></ul>
<ul
class=
"pagination pagination-dots"
></ul>
</div>
<div
style=
"display:none;"
>
<!-- Headline template element for List.js -->
<li
id=
"headline-item"
>
<div
class=
"header-inner h_tip"
>
<img
class=
"h_icon"
width=
"16px"
align=
"middle"
alt=
"📰"
></img>
<a
class=
"h_url h_title"
target=
"_blank"
></a>
</div>
</li>
<div
class=
"row"
>
<div
id=
"meta_press_logo"
class=
"col-md-3"
>
<center>
<img
src=
"img/logo-metapress-256px-bg.png"
width=
"233px"
title=
"Meta-Press.es logo by Elisa de Castro Guerra"
/>
</center>
</div>
<div
id=
"header"
class=
"col-md-6 hidden-xs"
>
<center>
<h1
class=
"blog-title"
>
Meta-Press.es
</h1>
<p
class=
"lead blog-description"
>
Decentralized press meta-search engine
</p>
</center>
</div>
<div
class=
"col-md-3"
></div>
<div
id=
"headlines"
class=
"col-md-9"
>
<ul
class=
"list"
></ul>
<ul
class=
"pagination pagination-dots"
></ul>
</div>
<div
style=
"display:none;"
>
<!-- Headline template element for List.js -->
<li
id=
"headline-item"
>
<div
class=
"header-inner h_tip"
>
<img
class=
"h_icon"
width=
"16px"
align=
"middle"
alt=
"📰"
></img>
<a
class=
"h_url h_title"
target=
"_blank"
></a>
</div>
</li>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-2"
></div>
...
...
js/meta-press.js
View file @
2fb3671f
...
...
@@ -696,20 +696,23 @@ import * as µ from "/js/utils.js"
})
function
load_headlines
()
{
headlineList
.
clear
()
current_source_selection
.
forEach
(
async
(
i
)
=>
{
var
n
=
sources_objs
[
i
]
if
(
!
n
.
headline_url
)
return
var
rep
=
await
fetch
(
n
.
headline_url
/*, {
method: "GET",
headers: { overrideMimeType: 'text/plain; charset=x-user-defined' }
}*/
)
let
i
=
0
current_source_selection
.
forEach
(
async
(
k
)
=>
{
// for (let k of current_source_selection) {
// let sub_load_headline = async () => {
let
n
=
sources_objs
[
k
]
if
(
!
n
.
headline_url
)
{
return
}
i
+=
1
console
.
log
(
i
)
µ
.
sleep
(
1000
*
i
)
let
rep
=
await
fetch
(
n
.
headline_url
)
if
(
!
rep
.
ok
)
throw
`status
${
rep
.
status
}
`
var
c_type
=
rep
.
headers
.
get
(
"
content-type
"
)
var
r
=
µ
.
dom_parser
.
parseFromString
(
await
rep
.
text
(),
µ
.
clean_c_type
(
c_type
))
if
(
!
n
.
domain_part
)
n
.
domain_part
=
µ
.
domain_part
(
n
.
headline_url
)
if
(
!
n
.
favicon_url
)
n
.
favicon_url
=
µ
.
get_favicon_url
(
r
,
n
.
domain_part
)
var
h
=
r
.
querySelector
(
n
.
headline_selector
)
let
c_type
=
rep
.
headers
.
get
(
"
content-type
"
)
let
r
=
µ
.
dom_parser
.
parseFromString
(
await
rep
.
text
(),
µ
.
clean_c_type
(
c_type
))
try
{
if
(
!
n
.
domain_part
)
n
.
domain_part
=
µ
.
domain_part
(
n
.
headline_url
)
if
(
!
n
.
favicon_url
)
n
.
favicon_url
=
µ
.
get_favicon_url
(
r
,
n
.
domain_part
)
var
h
=
r
.
querySelector
(
n
.
headline_selector
)
headlineList
.
add
({
h_title
:
µ
.
shorten
(
µ
.
triw
(
h
.
textContent
),
HEADLINE_TITLE_SIZE
),
h_url
:
µ
.
urlify
(
h
.
getAttribute
(
"
href
"
),
n
.
domain_part
),
...
...
@@ -717,7 +720,7 @@ import * as µ from "/js/utils.js"
h_tip
:
`Headline from "
${
i
}
" (
${
ndt
().
toLocaleString
()}
)\n`
+
`
${
µ
.
triw
(
h
.
textContent
)}
`
})
}
catch
(
err
)
{
console
.
error
(
"
header for
"
,
i
,
err
)
}
}
catch
(
err
)
{
console
.
error
(
"
header for
"
,
k
,
err
)
}
})
}
/* * * Tags * * */
...
...
js/sources.json
View file @
2fb3671f
...
...
@@ -629,7 +629,7 @@
"name"
:
"Financial Tribune (Iran)"
,
"headline_url"
:
"https://financialtribune.com"
,
"headline_selector"
:
".content .title a"
,
"search_url"
:
"https://financialtribune.com/search/site/
{}
?solrsort=ds_created%20desc"
,
"search_url"
:
"https://financialtribune.com/search/site/
\"
{}
\"
?solrsort=ds_created%20desc"
,
"results"
:
".search-result"
,
"r_h1"
:
"a"
,
"r_url"
:
"a"
,
...
...
@@ -1214,7 +1214,7 @@
"name"
:
"Plos one"
,
"headline_url"
:
"https://journals.plos.org/plosone"
,
"headline_selector"
:
".block-content h2 a"
,
"search_url"
:
"https://journals.plos.org/plosone/search/feed/atom?filterJournals=PLoSONE&q=
{}
&sortOrder=DATE_NEWEST_FIRST&page=1"
,
"search_url"
:
"https://journals.plos.org/plosone/search/feed/atom?filterJournals=PLoSONE&q=
\"
{}
\"
&sortOrder=DATE_NEWEST_FIRST&page=1"
,
"favicon_url"
:
"https://journals.plos.org/plosone/resource/img/favicon.ico"
,
"extends"
:
"ATOM_Plos"
,
"tags"
:
{
...
...
@@ -1280,7 +1280,7 @@
"name"
:
"Science Direct (Elsevier)"
,
"headline_url"
:
"https://www.sciencedirect.com"
,
"headline_selector"
:
".browse-subject-popular a"
,
"search_url"
:
"https://www.sciencedirect.com/search/api?qs=
{}
&sortBy=date&show={#}&navigation=true"
,
"search_url"
:
"https://www.sciencedirect.com/search/api?qs=
\"
{}
\"
&sortBy=date&show={#}&navigation=true"
,
"favicon_url"
:
"https://cdn.elsevier.io/verona/includes/favicons/favicon-192x192.png"
,
"type"
:
"JSON"
,
"res_nb"
:
"resultsFound"
,
...
...
@@ -1303,7 +1303,7 @@
"name"
:
"PeerCommunity Evolutionnary Biology"
,
"search_url"
:
"https://evolbiol.peercommunityin.org/public/recommended_articles"
,
"method"
:
"POST"
,
"body"
:
"qyKeywords=
{}
"
,
"body"
:
"qyKeywords=
\"
{}
\"
"
,
"res_nb"
:
"div.pci-nResults"
,
"res_nb_re"
:
[
"^(
\\
d+) "
,
"$1"
],
"results"
:
"tbody > tr.pci-lastArticles-row"
,
...
...
js/utils.js
View file @
2fb3671f
/* globals Uint8Array */
/* globals Uint8Array
, Promise
*/
// https://stackoverflow.com/questions/3700326/decode-amp-back-to-in-javascript
export
function
HTML_decode_entities
(
s
)
{
var
elt
=
document
.
createElement
(
'
textarea
'
)
...
...
@@ -123,6 +123,7 @@ export function clean_c_type(str) { return str.split(";")[0].replace(/(rss|atom)
case '%': return search_url.replace('{%}', encodeURIComponent(token))
}
}*/
export
function
sleep
(
duration
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
duration
))
}
// Evaluate an XPath expression aExpression against a given DOM node
// or Document object (aNode), returning the results as an array
// thanks wanderingstan at morethanwarm dot mail dot com for the
...
...
manifest.json
View file @
2fb3671f
...
...
@@ -2,7 +2,7 @@
"manifest_version"
:
2
,
"name"
:
"Meta-Press.es"
,
"description"
:
"Decentralized press meta-search engine"
,
"version"
:
"1.2.
2
"
,
"version"
:
"1.2.
3
"
,
"homepage_url"
:
"https://www.meta-press.es"
,
"author"
:
"Simon Descarpentries"
,
"icons"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment