WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
168749
Switch back to the Twitter API for the Tweet widget
https://bugs.webkit.org/show_bug.cgi?id=168749
Summary
Switch back to the Twitter API for the Tweet widget
Jon Davis
Reported
2017-02-22 15:30:22 PST
Switch back to using the Twitter API, with the push-tweet-listener as a trigger for updates and fallback if the API fails.
Attachments
Patch
(9.78 KB, patch)
2017-02-22 15:32 PST
,
Jon Davis
no flags
Details
Formatted Diff
Diff
Patch
(11.40 KB, patch)
2017-03-10 15:50 PST
,
Jon Davis
no flags
Details
Formatted Diff
Diff
Patch
(11.99 KB, patch)
2017-03-10 16:15 PST
,
Jon Davis
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Jon Davis
Comment 1
2017-02-22 15:32:13 PST
Created
attachment 302451
[details]
Patch
Matt Baker
Comment 2
2017-02-24 21:15:01 PST
Comment on
attachment 302451
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=302451&action=review
r=me, with many a nit! This is largely a style review and rubber-stamp, as I'm not familiar with the Twitter API. And since PHP is C-like, most of our WebKit coding standards are applicable and should be followed, at least: - $camelCaseIdentifiers - No spaces after/before open/close parenthesis in expressions, function signatures, etc - Function body open brace should start on a newline
> Websites/webkit.org/ChangeLog:6 > + Reviewed by NOBODY (OOPS!).
A brief description of the change would be nice.
> Websites/webkit.org/wp-content/themes/webkit/style.css:672 > +
Style: remove blank line.
> Websites/webkit.org/wp-content/themes/webkit/style.css:682 > + width: auto;
Style: move width above height, to match the order of the max-width/height pair below.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:28 > +
Style: remove whitespace.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:35 > + // return $this->follow_markup($options);
Remove commented code.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:50 > + if ( preg_match('!webkit.org/.+?!', $entry->expanded_url) == 1 ) {
Style: no need for spaces after open parenthesis/before close parenthesis.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:60 >
Style: remove blank line.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:85 > + <li><a href="
https://twitter.com/webkit
" target="twitter-modal"><span class="twitter-icon">Twitter</span>@webkit</a></li>
Nice housekeeping.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:121 > + $PushedTweet = false;
Style: $pushedTweet
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:154 > + $key = join('&', array_map('rawurlencode', array(
Should be all on one line.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:168 > );
Style: add a blank line before "// Wrap..."
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:169 > + // Wrap values in double-quotes
Style: end comments in a period
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:199 > + && preg_match('!webkit.org/.+?!', $Tweet->entities->urls[0]->expanded_url) == 1 ); // links to webkit.org somewhere
This function could be rewritten to be more readable. My PHP is rusty, but I think `count` returns 0 for null arguments, so the `empty($tweet->entities->urls)` check can be eliminated: function isWebKitLink($tweet) { if (empty($tweet->entities) || count($tweet->entities->urls != 1)) return false; return preg_match('!webkit.org/.+?!', $tweet->entities->urls[0]->expanded_url) == 1; } The comments don't add much that isn't obvious by reading the code, and can be omitted.
Matt Baker
Comment 3
2017-02-24 21:21:40 PST
Mismatched parenthesis in my code above, should be: if (empty($tweet->entities) || count($tweet->entities->urls) != 1) return false;
Jon Davis
Comment 4
2017-03-10 15:50:59 PST
Created
attachment 304087
[details]
Patch
Lucas Forschler
Comment 5
2017-03-10 16:12:45 PST
Comment on
attachment 304087
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=304087&action=review
r=me after fixing the leading whitespace.
> Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php:29 > +
looks like some extra whitespace here
Jon Davis
Comment 6
2017-03-10 16:15:41 PST
Created
attachment 304090
[details]
Patch
WebKit Commit Bot
Comment 7
2017-03-10 17:01:22 PST
Comment on
attachment 304090
[details]
Patch Clearing flags on attachment: 304090 Committed
r213740
: <
http://trac.webkit.org/changeset/213740
>
WebKit Commit Bot
Comment 8
2017-03-10 17:01:26 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug