tweeper: move the main Tweeper class to its own file under src/ This matches more closely the project structure expected by composer packages.
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 readability.
rss_converter_twitter.com.xsl: generate enclosure for images
rss_converter_twitter.com.xsl: 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 twitter.com page.
rss_converter_twitter.com.xsl: 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.
rss_converter_twitter.com.xsl: present images in a more convenient way Make images clickable and pointing to the original full-size picture.
rss_converter_twitter.com.xsl: show media content in the feed item description
rss_converter_twitter.com.xsl: use direct URLs for links, when possible Replace the t.co URLs with the actual location the link was originally meant to point to.
rss_converter_twitter.com.xsl: 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.
rss_converter_twitter.com.xsl: 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.
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.
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().
Rename epoch_to_gmdate to epochToGmdate, and str_to_gmdate to strToGmdate
Fix naming conventions for the generate_enclosure functon Use lowerCamel case for the function name, keep snake_case for the local variable in the php code, and use a dash-separated case for the xsl variable.
rss_converter_twitter.com.xsl: fix getting the profile picture URL
rss_converter_twitter.com.xsl: restrict tweet selection some more Only select elements which have the 'data-item-id' attribute, this way we avoid picking up the image gallery at the top of hashtag pages which does not have an RSS item structure. JFTR the gallery is inside an element like this: <li class="AdaptiveStreamImageGallery AdaptiveSearchTimeline-separationModule js-stream-item" data-item-type="tweet"> with no 'data-item-id'.
rss_converter_twitter.com.xsl: set a fall-back channel title When there is no screen-name, like for hashtag ans searches pages, use the main page title as the RSS channel title.
rss_converter_twitter.com.xsl: restrict the criterion to match actual tweets By only using li[@data-item-type='tweet'] sometimes void entries where selected, and in particular the ones under <ol class="activity-popup-users">. So just pick the items under <ol id="stream-items-id"> as the actual tweets with valid contents in them.
rss_converter_twitter.com.xsl: update XPath of tweet content Using the role attribute to differentiate between original tweets and quoted tweet, as introduced in commit 4c2e986, does not work anymore, but the fact that original tweets are <li></li> elements while quoted tweets are <div></div> elements can be used instead.
rss_converter_twitter.com.xsl: improve matching the permalink Extract the permalink using the @data-permalink-path attribute, this works for withheld tweets too preventing them from having all the same guid.