This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function _getIblError($response) { | |
try { | |
$body = $response->getBody(); | |
if (!$body) { | |
return "No body content"; | |
} | |
$json = json_decode($body); | |
if (!$json) { | |
return "Unable to parse body content"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get() could include try/catch. | |
Inside would fetch from iBL and parse response. | |
Parse can throw errors from each errored process inside _parseResponse(). | |
Remove handleErrors() and _getIblError, add _parseResponse(). | |
Response is moved to instance var (debatable, would give object a state). | |
checkJsonError does not throw anything unless finds an error. | |
Below an example, not complete: | |
private function _parseResponse() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pageTitle($page, $formStatus) { | |
$Localiser = new BBC_View_Helper_Localise(); | |
switch ($formStatus) { | |
case 'subscribe_request_success': // Subscribe Request Success page | |
$pageTitle = $Localiser->localise('newsletter_'.$page.'_subscribe_request_success_title'); | |
break; | |
case 'subscribe_request_failure': // Subscribe Request Failure page | |
$pageTitle = $Localiser->localise('newsletter_'.$page.'_subscribe_request_failure_title'); | |
break; | |
case 'subscribe_success': // Subscribe Success page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Channel | |
{ | |
protected $_identifier; | |
protected $_id; | |
protected $_iblId; | |
public function getIdentifier() { | |
return $this->_identifier; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Needs PhantomJS | |
uses Node.js File API | |
uses base64 encoding | |
event based on rendering image. | |
node modules: | |
JsDiff (https://github.com/kpdecker/jsdiff) | |
colors.js (https://github.com/brehaut/color-js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAV: | |
tvip-links-cats-channels-container { | |
- Channel Items | |
tvip-links-cats-container { | |
- Category Items | |
- Other Nav Link Items | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//open page | |
//var_dump($json);die; | |
//refresh | |
//Save as fixtures/bamboo/home_highlights_series_stacked.json | |
/iplayer?_fake=highlights@series_stacked | |
HTTP/1.1 200 OK | |
Server: Fixture | |
Content-Language: en-GB | |
Content-Type: application/json;charset=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('iplayer/controllers/Preview', | |
function() { | |
glow.events.addListener("#preview-opt-in a", "click", function(event) { | |
event.stopPropagation(); | |
event.preventDefault(); | |
var date = new Date(), | |
expires; | |
date.setTime(date.getTime()+(182*24*60*60*1000)); //6 months in future | |
expires = date.toGMTString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<~method domReadyInit> | |
require([ | |
'iplayer/controllers/DrawerManager', | |
'iplayer/controllers/OverlayManager', | |
'iplayer/controllers/UserRecommendations', | |
'iplayer/controllers/FriendsActivity', | |
'iplayer/controllers/RadioUpsell', | |
'iplayer/controllers/IstatsLinkTracking', | |
'iplayer/controllers/Arialandmarks', | |
'iplayer/controllers/Preview' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Machine on wifi , dev on IE8 | |
machine: | |
wifi to iplayer_mobile | |
-any turn proxies off | |
unplug eth | |
dev: | |
proxies off and extacess on | |
#reithproxies off | |
#extaccess pal-ct |
OlderNewer