/**
* Convert numeric Epoch to the date format expected in a RSS document.
*/
- public static function epoch_to_gmdate($timestamp) {
+ public static function epochToGmdate($timestamp) {
if (!is_numeric($timestamp) || is_nan($timestamp)) {
$timestamp = 0;
}
/**
* Convert generic date string to the date format expected in a RSS document.
*/
- public static function str_to_gmdate($date) {
+ public static function strToGmdate($date) {
$timestamp = strtotime($date);
if (FALSE === $timestamp) {
$timestamp = 0;
}
- return Tweeper::epoch_to_gmdate($timestamp);
+ return Tweeper::epochToGmdate($timestamp);
}
/**
* Get the contents from a URL.
*/
- private static function getContents($url) {
+ private static function getUrlContents($url) {
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_HEADER => FALSE,
/**
* Get the headers from a URL.
*/
- private static function getInfo($url) {
+ private static function getUrlInfo($url) {
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_HEADER => TRUE,
// See http://sourceforge.net/p/feedvalidator/bugs/72/
$http_url = preg_replace("/^https/", "http", $url);
- $url_info = Tweeper::getInfo($http_url);
+ $url_info = Tweeper::getUrlInfo($http_url);
$supported = in_array($url_info['content_type'], $supported_content_types);
if (!$supported) {
return NULL;
}
- $stylesheet_contents = $this->getContents($stylesheet);
+ $stylesheet_contents = $this->getUrlContents($stylesheet);
$xslDoc = new DOMDocument();
$xslDoc->loadXML($stylesheet_contents);
return NULL;
}
- $html = $this->getContents($src_url);
+ $html = $this->getUrlContents($src_url);
if (FALSE === $html) {
return NULL;
}