Closed
Bug 548758
Opened 15 years ago
Closed 15 years ago
creative.mozilla.org should not depend on 3rd party websites
Categories
(Websites :: creative.mozilla.org, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: fox2mike, Assigned: ryansnyder)
References
Details
Fallout from Bug #548745
Basically in application/controllers/home.php lies the following code snippet
if (!empty($response_array)) {
return $response_array;
} else {
$url = 'http://friendfeed.com/mozillacc?format=atom';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); //
Should allow results to be returned in a variable
curl_setopt($curl, CURLOPT_MAXREDIRS, 5); // So
we don't go too far down the rabbit hole
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
$response = curl_exec($curl);
curl_close($curl);
try {
$xml = new SimpleXMLElement($response);
When http://friendfeed.com/mozillacc?format=atom isn't available or is extremely slow, it impacts creative.m.o badly, throwing a 500 or causing creative.m.o to load extremely slowly.
We should _never_ depend on 3rd party websites to display any of our content, code should be modified to cover the following conditions :
1) If there is malformed xml, chuck the result, load the page
2) Have a quick timeout (bout 1-2 seconds), if there is no response, load the page
3) Think about storing the results in a file or memcache as a fall back. In fact, we should just resort to loading/refreshing the feed once every x mins
Right now, there's a patched up version live, with the try/catch block commented out, we need to clean this up and push the fix live.
| Assignee | ||
Comment 1•15 years ago
|
||
After talking with Tara, I've put together a Twitter javascript widget that will fail a bit more safely than the current RSS blog feed solution, and hopefully encourage more people to find MCC through their Twitter channel. Committing to get it up on stage, but waiting for feedback for proceeding.
==
Sending application/controllers/home.php
Sending application/views/home/home_index_sub.php
Sending mysql_schema.sql
Transmitting file data ...
Committed revision r63349.
==
Sending application/views/home/home_index_sub.php
Sending public_html/css/screen.css
Transmitting file data ..
Committed revision r63367.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → ryan
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 2•15 years ago
|
||
Committed changes recommended by Tara.
==
Sending application/views/home/home_index_sub.php
Sending modules/auth/controllers/auth.php
Sending public_html/css/screen.css
Transmitting file data ...
Committed revision r63943.
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 3•15 years ago
|
||
Adding Twitter icon to bottom of feed...
==
Sending application/views/home/home_index_sub.php
Sending public_html/css/screen.css
Adding (bin) public_html/images/twitter.png
Transmitting file data ...
Committed revision r63977.
You need to log in
before you can comment on or make changes to this bug.
Description
•