4 years agosrc/ make images more adaptive
Antonio Ospite [Mon, 13 Aug 2018 15:14:25 +0000 (17:14 +0200)]
src/ make images more adaptive

Adapt images to the screen width to avoid horizontal scrolling in the
feed reader.

4 years agoTweeper.php: bump version in the User-Agent string
Antonio Ospite [Mon, 13 Aug 2018 15:08:03 +0000 (17:08 +0200)]
Tweeper.php: bump version in the User-Agent string

By using a more recent version of the User-Agent, will
return more entries in the result when visiting hashtag pages.

This makes tracking hashtag pages more usable.

This change is similar to what was done in commit 0db2f37 ("Tweeper.php:
bump version in the User-Agent string", 2018-06-06)

5 years agoNEWS: add release notes for the v1.3.0 release v1.3.0
Antonio Ospite [Wed, 6 Jun 2018 13:50:13 +0000 (15:50 +0200)]
NEWS: add release notes for the v1.3.0 release

5 years agosrc/ only output channel image when it's available
Antonio Ospite [Wed, 6 Jun 2018 13:36:39 +0000 (15:36 +0200)]
src/ only output channel image when it's available

Hashtag pages do not have an image usable as a channel logo, and in
cases like this the <url/> element would be empty, but this would make
the feed invalid according to

So, to produce feeds which validate, avoid outputting the whole <image/>
element when there is no suitable image to use as a channel logo.

5 years agosrc/ fix getting description for hashtag pages
Antonio Ospite [Wed, 6 Jun 2018 13:34:12 +0000 (15:34 +0200)]
src/ fix getting description for hashtag pages

5 years agoTODO: remove the entry about instagram tags, tweeper can now track them
Antonio Ospite [Wed, 6 Jun 2018 12:59:30 +0000 (14:59 +0200)]
TODO: remove the entry about instagram tags, tweeper can now track them

5 years agosrc/ add support for tags
Antonio Ospite [Wed, 6 Jun 2018 12:57:10 +0000 (14:57 +0200)]
src/ add support for tags

Supporting Instagram tags is quite easy, so let's do it and while at it
refactor how the channel description is set depending of the kind of

5 years agosrc/ fix getting the channel logo URL
Antonio Ospite [Wed, 6 Jun 2018 12:46:07 +0000 (14:46 +0200)]
src/ fix getting the channel logo URL

5 years agoTweeper.php: bump version in the User-Agent string
Antonio Ospite [Wed, 6 Jun 2018 11:20:28 +0000 (13:20 +0200)]
Tweeper.php: bump version in the User-Agent string

By using a more recent version of the User-Agent, will
return more entries in the result when visiting hashtag pages.

This makes tracking hashtag pages actually usable.

Tested with

5 years agoTweeper.php: update the User-Agent string to fix parsing
Antonio Ospite [Thu, 24 May 2018 21:43:16 +0000 (23:43 +0200)]
Tweeper.php: update the User-Agent string to fix parsing

It looks like started serving the mobile version of the site
to old browsers and Tweeper cannot parse that content.

By using a more up to date User-Agent string returns the
desktop version of the page which Tweeper can process without problems.

5 years don't put location coordinates in screen name
Antonio Ospite [Tue, 3 Apr 2018 16:12:22 +0000 (18:12 +0200)] don't put location coordinates in screen name

Remove location coordinates from the location screen name as the latter
also shows up in item titles, but still emit the coordinates in the
channel description.

5 years use the screen name in item titles
Antonio Ospite [Tue, 3 Apr 2018 16:11:04 +0000 (18:11 +0200)] use the screen name in item titles

The user name is not always defined, for example in case of locations,
so use the screen name in item titles.

5 years fix scraping
Antonio Ospite [Tue, 3 Apr 2018 16:08:59 +0000 (18:08 +0200)] fix scraping

5 years show again the user name in the description
Antonio Ospite [Fri, 16 Mar 2018 11:49:41 +0000 (12:49 +0100)] show again the user name in the description

Having the user name also in the description makes it easier to see who
the author is in case of re-tweeted messages.

Leave the line-break after the username to have the actual message start
at the beginning of the line, this is done to preserve the formatting of
the original message as much as possible.

5 years agoUpdate copyright years
Antonio Ospite [Thu, 15 Mar 2018 08:04:15 +0000 (09:04 +0100)]
Update copyright years

5 years agoINSTALL: add some notes for about dependencies
Antonio Ospite [Thu, 15 Mar 2018 08:00:03 +0000 (09:00 +0100)]
INSTALL: add some notes for about dependencies

5 years agoINSTALL: explain better what "usable HTML" means in this context
Antonio Ospite [Thu, 15 Mar 2018 07:30:16 +0000 (08:30 +0100)]
INSTALL: explain better what "usable HTML" means in this context

5 years agoNEWS: add release notes for the v1.2.0 release v1.2.0
Antonio Ospite [Sat, 24 Feb 2018 15:29:31 +0000 (16:29 +0100)]
NEWS: add release notes for the v1.2.0 release

5 years fix validation for Instagram location feeds
Antonio Ospite [Sat, 24 Feb 2018 14:33:58 +0000 (15:33 +0100)] fix validation for Instagram location feeds

Avoid outputting an <image/> element without an empty <url/>, this
breaks validation.

5 years agoTweeper.php: a more robust fix for 4b9692a19e06f3cf698d23a3854fd34b9914a32a
Antonio Ospite [Fri, 23 Feb 2018 15:10:52 +0000 (16:10 +0100)]
Tweeper.php: a more robust fix for 4b9692a19e06f3cf698d23a3854fd34b9914a32a

The "qe" element in the json data is the one containing the problematic
element mentioned in commit 4b9692a19e06f3cf698d23a3854fd34b9914a32a and
it may contain multiple elements with problematic names, so just remove
the "qe" element altogether.

5 years preserve spaces in tweet content
Antonio Ospite [Fri, 23 Feb 2018 14:34:02 +0000 (15:34 +0100)] preserve spaces in tweet content

Wrap the tweet content into a span element with a CSS style attribute
set to "white-space: pre-wrap", this allows to have the spaces rendered
like on the twitter web page: with spaces and newlines preserved.

This is especially desirable if the tweet content contains any ASCII
art, like in

5 years add support for permalink URLs
Antonio Ospite [Fri, 23 Feb 2018 14:29:44 +0000 (15:29 +0100)] add support for permalink URLs

This way it is possible to generate an RSS feed of all the replies to
a certain tweet using its permalink URL.

5 years add a line break after the "(Video)" label
Antonio Ospite [Fri, 23 Feb 2018 13:55:10 +0000 (14:55 +0100)] add a line break after the "(Video)" label

This is to start the actual original tweet content on a new line, this
is important for example if the content contains some ASCII art.

5 years don't print the user name in description
Antonio Ospite [Fri, 23 Feb 2018 13:48:06 +0000 (14:48 +0100)] don't print the user name in description

This is in the spirit of leaving the tweet content untouched as much as

5 years use a different rule to get the tweet user-name
Antonio Ospite [Fri, 23 Feb 2018 13:43:57 +0000 (14:43 +0100)] use a different rule to get the tweet user-name

Instead of looking for 'js-stream-tweet' in the class attribute, pick
the element which has the 'data-tweet-id' attribute, this is more
generic and works also with permalink tweets.

5 years agoTweeper.php: fix converting Instagram data to RSS
Antonio Ospite [Sun, 14 Jan 2018 18:46:54 +0000 (19:46 +0100)]
Tweeper.php: fix converting Instagram data to RSS

There is one new element in the json data served by Instagram named
"404_as_react", and this makes the conversion from json to XML fail
because names starting with a number are illegal in XML.

Fix the problem by prepending an underscore to the problematic name.

5 years fix channel link, image, and description
Antonio Ospite [Mon, 6 Nov 2017 17:15:59 +0000 (18:15 +0100)] fix channel link, image, and description

5 years fix scraping pages once again
Antonio Ospite [Mon, 6 Nov 2017 16:53:42 +0000 (17:53 +0100)] fix scraping pages once again

Add back support for 'userContentWrapper' which seems to be still used.

5 years agoTODO: add an entry about Instagram tags
Antonio Ospite [Mon, 6 Nov 2017 16:52:56 +0000 (17:52 +0100)]
TODO: add an entry about Instagram tags

5 years fix scraping pages once again
Antonio Ospite [Mon, 11 Sep 2017 11:17:31 +0000 (13:17 +0200)] fix scraping pages once again

Tip: in order to get more posts, and not just the last two, append
"/posts" to the facebook page URL, or use the URL of the "See all" link
in the "Posts" section.

5 years support scraping Instagram locations pages
Antonio Ospite [Mon, 10 Jul 2017 08:29:01 +0000 (10:29 +0200)] support scraping Instagram locations pages

5 years improve the comment about full names
Antonio Ospite [Mon, 10 Jul 2017 08:05:31 +0000 (10:05 +0200)] improve the comment about full names

5 years agoNEWS: add release notes for the v1.1.0 release v1.1.0
Antonio Ospite [Tue, 27 Jun 2017 10:01:14 +0000 (12:01 +0200)]
NEWS: add release notes for the v1.1.0 release

5 years agoTODO: add an entry about the use of trigger_error()
Antonio Ospite [Tue, 27 Jun 2017 08:59:31 +0000 (10:59 +0200)]
TODO: add an entry about the use of trigger_error()

5 years agoRemove support for, the old blog is not available anymore
Antonio Ospite [Tue, 27 Jun 2017 08:45:47 +0000 (10:45 +0200)]
Remove support for, the old blog is not available anymore

5 years agoAdd an example of instrumentation to capture the HTML for later analysis
Antonio Ospite [Thu, 22 Jun 2017 08:52:41 +0000 (10:52 +0200)]
Add an example of instrumentation to capture the HTML for later analysis

5 years filter out promoted tweets
Antonio Ospite [Thu, 22 Jun 2017 08:47:35 +0000 (10:47 +0200)] filter out promoted tweets

5 years strip the style attribute from HTML elements
Antonio Ospite [Thu, 8 Jun 2017 13:35:27 +0000 (15:35 +0200)] strip the style attribute from HTML elements

Elements in an RSS item description are not supposed to have a style
attribute, and they don't really need to anyways, so filter it out in
the identity template.

This also fixes an issue with Twitter images being shown with a offset
in liferea.

6 years match both the new and the old wrapper class
Antonio Ospite [Wed, 8 Mar 2017 08:20:01 +0000 (09:20 +0100)] match both the new and the old wrapper class

Facebook still seems to use the "userContentWrapper" sometimes, it's not
clear if "fbUserContent" was only used for a short period of time or if
both are actually used; in the doubt support both.

6 years agoHACKING: add instructions about installing the Drupal style in PHP_CodeSniffer
Antonio Ospite [Tue, 14 Feb 2017 08:41:35 +0000 (09:41 +0100)]
HACKING: add instructions about installing the Drupal style in PHP_CodeSniffer

6 years agoAdd the helper script tests/tweeper_file
Antonio Ospite [Thu, 9 Feb 2017 17:21:17 +0000 (18:21 +0100)]
Add the helper script tests/tweeper_file

The script allows to scrape a local file, this speeds up development and

6 years agoAdd the helper script tests/
Antonio Ospite [Thu, 9 Feb 2017 17:15:54 +0000 (18:15 +0100)]
Add the helper script tests/

The script helps retrieving the actual html of a public page on, ignoring the pages which require the CAPTCHA.

This allows to have a local copy of the page to test tweeper on.

6 years agoTweeper.php: allow to pass parameters to Tweeper::tweep()
Antonio Ospite [Thu, 9 Feb 2017 15:48:55 +0000 (16:48 +0100)]
Tweeper.php: allow to pass parameters to Tweeper::tweep()

This allows to call Tweeper::tweep() on file:// URLs which can make
development faster.

6 years fix the URL of the channel image
Antonio Ospite [Thu, 9 Feb 2017 14:49:59 +0000 (15:49 +0100)] fix the URL of the channel image

6 years new wrapper classname
David Kalnischkies [Wed, 8 Feb 2017 23:52:00 +0000 (00:52 +0100)] new wrapper classname

Facebook seems to have changed the classname of the wrapping div
from "userContentWrapper" to "fbUserContent".

6 years agoNEWS: add release notes for the v1.0.0 release v1.0.0
Antonio Ospite [Sun, 11 Dec 2016 09:23:20 +0000 (10:23 +0100)]
NEWS: add release notes for the v1.0.0 release

The release numbering scheme has been changed to match what composer

6 years agocomposer.json: make the dependencies on symfony components more relaxed
Antonio Ospite [Sat, 10 Dec 2016 23:38:14 +0000 (00:38 +0100)]
composer.json: make the dependencies on symfony components more relaxed

6 years agoMakefile: mention DESTDIR in the "INSTALLATION COMPLETE" message
Antonio Ospite [Sat, 10 Dec 2016 21:01:47 +0000 (22:01 +0100)]
Makefile: mention DESTDIR in the "INSTALLATION COMPLETE" message

6 years agoMakefile: make the symlink in BIN_DIR refer to the executable in DESTDIR
Antonio Ospite [Sat, 10 Dec 2016 20:59:19 +0000 (21:59 +0100)]
Makefile: make the symlink in BIN_DIR refer to the executable in DESTDIR

Also make the symlink relative, this way it is always valid whether
DESTDIR is specified or not.

6 years agoMakefile: fix installation after the code restructuring
Antonio Ospite [Sat, 10 Dec 2016 20:57:38 +0000 (21:57 +0100)]
Makefile: fix installation after the code restructuring

6 years agotweeper: allow running tweeper from vendor/bin also when it's not a symlink
Antonio Ospite [Sat, 10 Dec 2016 18:34:57 +0000 (19:34 +0100)]
tweeper: allow running tweeper from vendor/bin also when it's not a symlink

6 years agoautoload.php: improve the comment about the system-wide dependencies
Antonio Ospite [Sun, 6 Nov 2016 09:06:19 +0000 (10:06 +0100)]
autoload.php: improve the comment about the system-wide dependencies

6 years agoTODO: add a note about the version of the dependencies in composer.json
Antonio Ospite [Sun, 6 Nov 2016 08:43:06 +0000 (09:43 +0100)]
TODO: add a note about the version of the dependencies in composer.json

6 years agoUpdate copyright years in recently modified files
Antonio Ospite [Sat, 5 Nov 2016 18:25:05 +0000 (19:25 +0100)]
Update copyright years in recently modified files

6 years agotweeper: allow to run tweeper either with or without composer
Antonio Ospite [Sat, 5 Nov 2016 16:55:56 +0000 (17:55 +0100)]
tweeper: allow to run tweeper either with or without composer

6 years agoAdd a composer.json file
Antonio Ospite [Fri, 4 Nov 2016 12:18:08 +0000 (13:18 +0100)]
Add a composer.json file

6 years agorss_converters_*.xsl: prefix the namespace when calling Tweeper class methods
Antonio Ospite [Fri, 4 Nov 2016 17:02:11 +0000 (18:02 +0100)]
rss_converters_*.xsl: prefix the namespace when calling Tweeper class methods

The Tweeper class is now in a namespace, without this change the XSLT
processor would give errors like this:

PHP Warning:  XSLTProcessor::transformToXml(): Unable to call handler Tweeper::epochToRssDate() in .../src/Tweeper.php on line 356

6 years agotweeper: move the main Tweeper class to its own file under src/
Antonio Ospite [Fri, 4 Nov 2016 12:13:54 +0000 (13:13 +0100)]
tweeper: move the main Tweeper class to its own file under src/

This matches more closely the project structure expected by composer

6 years agoTODO: improve wording and remove fullstops at the end of items
Antonio Ospite [Fri, 4 Nov 2016 15:02:26 +0000 (16:02 +0100)]
TODO: improve wording and remove fullstops at the end of items

6 years agoFix information leakage by validating the URL scheme
Antonio Ospite [Sun, 30 Oct 2016 10:34:22 +0000 (11:34 +0100)]
Fix information leakage by validating the URL scheme

Validate the scheme to prevent leaking information by abusing the
file:// scheme.

Before this change it was possible to see what files are available on
the system running tweeper.

The script in tests/ shows the problem on
earlier versions.

Here is an execution with tweeper-0.6:

URL file://
--> /etc/passwd

URL file://
... /etc/file_with_an_unlikely_name
    does not exist

Staring a test server

URL file://
--> /etc/passwd on http://localhost:8000

URL file://
... /etc/file_with_an_unlikely_name on http://localhost:8000
    does not exist

Shutting down the test server

Here is an execution after this fix:

PHP Fatal error:  unsupported scheme: file in /home/ao2/Proj/Tweeper/tweeper/tweeper.php on line 323
URL file://
... /etc/passwd
    does not exist

PHP Fatal error:  unsupported scheme: file in /home/ao2/Proj/Tweeper/tweeper/tweeper.php on line 323
URL file://
... /etc/file_with_an_unlikely_name
    does not exist

Staring a test server

URL file://
... /etc/passwd on http://localhost:8000
    does not exist

URL file://
... /etc/file_with_an_unlikely_name on http://localhost:8000
    does not exist

Shutting down the test server

6 years agotweeper.php: check the return value of Tweeper::tweep()
Antonio Ospite [Sun, 30 Oct 2016 09:28:41 +0000 (10:28 +0100)]
tweeper.php: check the return value of Tweeper::tweep()

If the tweep() method fails return 1 to the calling process so that it
can know that something failed.

6 years agotweeper.php: check curl_exec() return value
Antonio Ospite [Sun, 30 Oct 2016 09:04:51 +0000 (10:04 +0100)]
tweeper.php: check curl_exec() return value

Also show the message of curl_error() when curl_exec() fails, this way
it's easier to diagnose problems.

6 years agotweeper.php: support "application/pdf" as an enclosure content type
Antonio Ospite [Sat, 29 Oct 2016 17:34:10 +0000 (19:34 +0200)]
tweeper.php: support "application/pdf" as an enclosure content type

6 years agotweeper.php: support "application/octet-stream" as an enclosure content type
Antonio Ospite [Sat, 29 Oct 2016 17:17:00 +0000 (19:17 +0200)]
tweeper.php: support "application/octet-stream" as an enclosure content type

This allows binary attachment without a more specific content type to be
supported for the enclosure element.

Adding "application/octet-stream" also covers the weird case of servers
sending multiple Content-Type headers, e.g.:

< HTTP/1.1 200 OK
< Server: Apache
< ETag: "a46d495ba00c35580f83344dd523ece2:1473631283"
< Last-Modified: Sun, 11 Sep 2016 22:01:22 GMT
< Accept-Ranges: bytes
< Content-Length: 14346711
< Content-Type: audio/mpeg
< Content-Type: application/octet-stream
< content-disposition: attachment
< Date: Mon, 26 Sep 2016 23:36:11 GMT
< Connection: keep-alive
< Content-Type: application/octet-stream
< content-disposition: attachment

In this case the ideal solution would be to use the more _specific_
content type, but CURL just remembers the _last_ one ad it's not really
worth parsing the HTTP headers in tweeper just for this rare scenario.

Reported-by: Torsten Grote
7 years agoNEWS: add release notes for the v0.6 release v0.6
Antonio Ospite [Mon, 23 May 2016 14:17:37 +0000 (16:17 +0200)]
NEWS: add release notes for the v0.6 release

7 years strip unneeded trailing space
Antonio Ospite [Mon, 23 May 2016 14:16:57 +0000 (16:16 +0200)] strip unneeded trailing space

7 years agoAdd a HACKING file to describe the coding style used in the project
Antonio Ospite [Mon, 23 May 2016 13:55:34 +0000 (15:55 +0200)]
Add a HACKING file to describe the coding style used in the project

7 years agoINSTALL: mention php-symfony-property-access as a dependency
Antonio Ospite [Mon, 23 May 2016 13:45:43 +0000 (15:45 +0200)]
INSTALL: mention php-symfony-property-access as a dependency

7 years agotweeper.php: fix a problem with https URLs ending up in the enclosure element
Antonio Ospite [Mon, 23 May 2016 13:32:27 +0000 (15:32 +0200)]
tweeper.php: fix a problem with https URLs ending up in the enclosure element

When the remote host forces every URLs to be redirected to https, the
info returned by Tweeper::getUrlInfo() would contain an https URL, which
will end up being used in the "url" attribute of the enclosure element,
and this is invalid according to the RSS specification.

So make sure that an http URL is actually used for the "url" attribute.

7 years agoUse php:functionString() in the stylesheets where appropriate
Antonio Ospite [Mon, 23 May 2016 13:28:07 +0000 (15:28 +0200)]
Use php:functionString() in the stylesheets where appropriate

Instead of converting to string in XSL and then calling php:function(),
use directly php:functionString() when calling PHP functions which
actually expect a string argument.

Besides possible performance improvements, this is done mainly for

7 years agoDon't convert the timestamp to a number when calling php:functionString()
Antonio Ospite [Mon, 23 May 2016 12:58:45 +0000 (14:58 +0200)]
Don't convert the timestamp to a number when calling php:functionString()

It's not needed to convert the $timestamp variable to a number before
passing it as an argument to php:functionString() as the latter will
convert it to a string anyways.

7 years agoTODO: remove entry about using enclosure for images
Antonio Ospite [Mon, 23 May 2016 12:52:18 +0000 (14:52 +0200)]
TODO: remove entry about using enclosure for images

7 years add enclosure element for images
Antonio Ospite [Mon, 23 May 2016 12:51:38 +0000 (14:51 +0200)] add enclosure element for images

7 years agoTODO: remove the item about enclosures for, now they are supported
Antonio Ospite [Fri, 20 May 2016 16:25:28 +0000 (18:25 +0200)]
TODO: remove the item about enclosures for, now they are supported

7 years don't use a template for the enclosure
Antonio Ospite [Fri, 20 May 2016 16:17:59 +0000 (18:17 +0200)] don't use a template for the enclosure

Each post has exactly one image, it is enough to copy the generated
element in-place without applying templates.

7 years add support for the <enclosure/> element
Antonio Ospite [Fri, 20 May 2016 16:15:29 +0000 (18:15 +0200)] add support for the <enclosure/> element

7 years agoTODO: add an entry about adding direct links to Instagram videos
Antonio Ospite [Fri, 20 May 2016 16:06:32 +0000 (18:06 +0200)]
TODO: add an entry about adding direct links to Instagram videos

7 years make images adapt to the viewer width
Antonio Ospite [Fri, 20 May 2016 16:05:29 +0000 (18:05 +0200)] make images adapt to the viewer width

This way the user does not have to scroll horizontally to see the whole

7 years use a stricter match for some elements
Antonio Ospite [Fri, 20 May 2016 16:01:44 +0000 (18:01 +0200)] use a stricter match for some elements

7 years fix the channel link
Antonio Ospite [Fri, 20 May 2016 16:00:50 +0000 (18:00 +0200)] fix the channel link

7 years agoTODO: update the entry about twitter images and cards, images are now supported
Antonio Ospite [Fri, 20 May 2016 12:40:31 +0000 (14:40 +0200)]
TODO: update the entry about twitter images and cards, images are now supported

7 years generate enclosure for images
Antonio Ospite [Fri, 20 May 2016 12:04:03 +0000 (14:04 +0200)] generate enclosure for images

7 years show explicitly if the item has a video
Antonio Ospite [Fri, 20 May 2016 11:57:26 +0000 (13:57 +0200)] show explicitly if the item has a video

Tweeper does not provide direct links to videos, so it's useful to tell
users that the content has a video so they can follow the link and view
it on the page.

7 years don't repeat background in embedded media
Antonio Ospite [Fri, 20 May 2016 11:48:00 +0000 (13:48 +0200)] don't repeat background in embedded media

Tweeper doesn't provide direct links to videos and vines from twitter
but it still shows the preview picture provided by the original HTML
code; unfortunately the picture repeats itself, so avoid that.

7 years present images in a more convenient way
Antonio Ospite [Fri, 20 May 2016 11:33:01 +0000 (13:33 +0200)] present images in a more convenient way

Make images clickable and pointing to the original full-size picture.

7 years show media content in the feed item description
Antonio Ospite [Fri, 20 May 2016 11:18:42 +0000 (13:18 +0200)] show media content in the feed item description

7 years use direct URLs for links, when possible
Antonio Ospite [Fri, 20 May 2016 09:10:43 +0000 (11:10 +0200)] use direct URLs for links, when possible

Replace the URLs with the actual location the link was originally
meant to point to.

7 years add a mode attribute to the enclosure template
Antonio Ospite [Wed, 18 May 2016 11:28:01 +0000 (13:28 +0200)] add a mode attribute to the enclosure template

This is needed because another template with
match="a[@data-expanded-url]" will be added in a future commit.

7 years cleanup titles
Antonio Ospite [Wed, 18 May 2016 20:41:54 +0000 (22:41 +0200)] cleanup titles

Prepend a white space in front of some URLs (those not preceded by an
open parenthesis) because otherwise they get rendered attached to the
preceding text.

Also strip non-breaking spaces and horizontal ellipses, they are not
needed because the RSS feed show the full URLs.

7 years agotweeper.php: add "image/png" to the supported types for <enclosure/>
Antonio Ospite [Wed, 18 May 2016 20:38:35 +0000 (22:38 +0200)]
tweeper.php: add "image/png" to the supported types for <enclosure/>

7 years agotweeper.php: rename DomDocument() to DOMDocument()
Antonio Ospite [Wed, 18 May 2016 20:35:28 +0000 (22:35 +0200)]
tweeper.php: rename DomDocument() to DOMDocument()

DOMDocument() is the more used form, it is also already used in some
other parts of the file.

7 years agoReturn a DOMElement instead of a string in Tweeper::generateEnclosure()
Antonio Ospite [Wed, 18 May 2016 20:32:06 +0000 (22:32 +0200)]
Return a DOMElement instead of a string in Tweeper::generateEnclosure()

This make the generated XML have proper indentation in case the
<enclosure/> element gets added.

7 years agotweeper.php: move the loadStylesheet() method more down in the file
Antonio Ospite [Wed, 18 May 2016 10:10:15 +0000 (12:10 +0200)]
tweeper.php: move the loadStylesheet() method more down in the file

This way all static methods are grouped together before non-static

7 years agotweeper.php: write XML in upper case inside comments
Antonio Ospite [Wed, 18 May 2016 09:13:45 +0000 (11:13 +0200)]
tweeper.php: write XML in upper case inside comments

7 years agotweeper.php: make jsonToXml() a static method
Antonio Ospite [Wed, 18 May 2016 09:06:34 +0000 (11:06 +0200)]
tweeper.php: make jsonToXml() a static method

7 years agotweeper.php: make logXmlError() a static method
Antonio Ospite [Wed, 18 May 2016 08:56:40 +0000 (10:56 +0200)]
tweeper.php: make logXmlError() a static method

7 years agotweeper.php: make it clearer that getUrlContents is a static method
Antonio Ospite [Tue, 17 May 2016 22:08:15 +0000 (00:08 +0200)]
tweeper.php: make it clearer that getUrlContents is a static method

7 years agotweeper.php: fix naming conventions for the get_xml_ and preprocess_html_ funcs
Antonio Ospite [Tue, 17 May 2016 22:05:22 +0000 (00:05 +0200)]
tweeper.php: fix naming conventions for the get_xml_ and preprocess_html_ funcs

7 years agotweeper.php: rename the ERROR_STREAM variable to error_stream
Antonio Ospite [Tue, 17 May 2016 21:37:35 +0000 (23:37 +0200)]
tweeper.php: rename the ERROR_STREAM variable to error_stream

Variables should be in lower case.

7 years agoUse more accurate names for the date conversion functions
Antonio Ospite [Tue, 17 May 2016 21:28:45 +0000 (23:28 +0200)]
Use more accurate names for the date conversion functions

The new names are epochToRssDate and strToRssDate.

Don't refer to gmdate() in the function names, this is just an
implementation detail which should not have leaked into the external
interface, instead mention RssDate in the function names to communicate
something about the output they produce.

Also, while at it, user the DATE_RSS format when calling gmdate().