Skip to content

Display photo, video, and emojis in tweets; support of Twitter extended tweet format.#5

Open
jlj wants to merge 4 commits intoryancramerdesign:masterfrom
jlj:master
Open

Display photo, video, and emojis in tweets; support of Twitter extended tweet format.#5
jlj wants to merge 4 commits intoryancramerdesign:masterfrom
jlj:master

Conversation

@jlj
Copy link

@jlj jlj commented Jan 24, 2015

Hi Ryan,
This PR contains the fixes for a number of small problems I found when integrating MarkupTwitterFeed to my website.
Jean-Luc

  • line 125: removed unnecessary require tmhOAuth/tmhUtilities.php;
  • lines 165-175: if the communication with Twitter fails, fallback to the cache file, if it exists;
  • line 197: fix an exception in method getIterator if getData returns false;
  • line 250: make method renderItem public, so that it can be called from inside a foreach ($t as $tweetItem) loop.
    Example of use:
    $t = $modules->get('MarkupTwitterFeed'); 
    $renderOptions = array(
        'showDate' => 'before',
        'dateFormat' => __("M j, Y"), // Tweet block date format
    ); 

    foreach($t as $tweet) {
        if (strtotime($tweet['created_at']) >= $minTime) {
            $out .= $t->renderItem($tweet, $renderOptions);
        }
        else break; // tweet date before $minTime
    }
  • lines 323, 327: replaced the incorrect configuration input field name cacheTime by cacheSeconds, so that the cache duration configuration is taken into account.

jlj added 3 commits January 24, 2015 22:51
- line 125: removed unnecessary require `tmhOAuth/tmhUtilities.php`;
- lines 165-175: if the communication with Twitter fails, fallback to the cache file, if it exists;
- line 197: fix an exception in method `getIterator` if `getData` returns false;
- line 250: make method `renderItem` public, so that it can be called from inside a `foreach ($t as $tweetItem)` loop
- lines 323, 327: replaced the incorrect configuration input field name `cacheTime` by `cacheSeconds`, so that the cache duration configuration is taken into account.
… retweets; support of Twitter extended tweet format.

Added options:
- 'listItemDate': tweet date markup, containing a '{date}' placeholder; replaces 'listItemDateOpen' and 'listItemDateClose';
- 'listItemLink': tweet links markup, containing a '{href}' and a '{url}' (user visible url) placeholder; replaces 'listItemLinkOpen' and 'listItemLinkClose';
- 'listItemPhoto': tweet photo markup, containing a '{src}'  and a '{title}' placeholder;
- 'listItemVideo': tweet video markup, containing a '{video_tag}' placeholder; this placeholder is be replaced by html5 video markup;
- 'listItemRetweetText': specific markup for retweets; can contain '{author_icon_url}', '{author}', and '{text}' placeholders ({text} is replaced by the content of the tweet, including eventual photo or video markup);
- 'videoAttributes': attributes of html5 video tags (e.g. "autoplay loop muted");
- 'preserveLineBreaks': if `true`, every line break in the tweet is replaced by a `<br>` tag; if `"coalesce"`, every group of consecutive line breaks is replaced by a single `<br>` tag; otherwise line breaks in the tweet are left unchanged.
@jlj jlj changed the title Fixed exception and configuration issue; minor improvements Display photo, video, and emojis in tweets; support of Twitter extended tweet format. Nov 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant