Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yPhil
Pétrolette
Commits
760c463e
Commit
760c463e
authored
Aug 06, 2020
by
yPhil
Browse files
New IMG detection routine, before a big cleanup of this mess
parent
9eda3136
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/js/PTL.feed.js
View file @
760c463e
...
...
@@ -260,6 +260,9 @@ PTL.feed = {
$
.
each
(
data
.
feedItems
,
function
(
index
,
item
)
{
// PTL.util.console('PLOP', 'warning');
if
(
index
==
parseInt
(
feedLimit
))
return
false
;
// console.log('i: (%s)', JSON.stringify(item));
...
...
@@ -326,7 +329,15 @@ PTL.feed = {
}
if
(
typeof
item
.
enclosures
[
0
]
!==
'
undefined
'
&&
item
.
enclosures
[
0
].
url
)
{
if
(
!
imageUrl
&&
imgTypes
.
indexOf
(
item
.
enclosures
[
0
].
type
)
>
-
1
)
{
if
(
item
.
enclosures
[
0
].
url
&&
item
.
enclosures
[
0
].
url
.
endsWith
(
"
.jpg
"
))
{
console
.
log
(
'
Wopop on %s!: (%s) imageUrl: %s
'
,
feedUrl
,
item
.
enclosures
[
0
].
url
,
imageUrl
);
imageUrl
=
item
.
enclosures
[
0
].
url
;
}
if
(
imgTypes
.
indexOf
(
item
.
enclosures
[
0
].
type
)
>
-
1
)
{
imageUrl
=
item
.
enclosures
[
0
].
url
;
}
...
...
routes/index.js
View file @
760c463e
...
...
@@ -117,7 +117,7 @@ function getFeed (urlfeed, callback) {
})
.
on
(
'
error
'
,
function
(
err
)
{
var
meta
=
this
.
meta
;
console
.
log
(
'
HUM (%s)
'
,
err
,
meta
.
title
);
console
.
log
(
'
HU
U
M (%s)
%s %s
'
,
err
,
meta
.
title
,
urlfeed
);
// callback ('err');
})
.
on
(
'
end
'
,
function
()
{
...
...
Write
Preview
Supports
Markdown
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