projects
/
tweeper.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix naming conventions for the generate_enclosure functon
[tweeper.git]
/
tweeper.php
diff --git
a/tweeper.php
b/tweeper.php
index
5379be7
..
f712c87
100644
(file)
--- a/
tweeper.php
+++ b/
tweeper.php
@@
-32,7
+32,7
@@
date_default_timezone_set('UTC');
*/
class Tweeper {
*/
class Tweeper {
- private static $
USER_AGENT
= "Mozilla/5.0 (Windows NT 6.1; rv:22.0) Gecko/20130405 Firefox/22.0";
+ private static $
userAgent
= "Mozilla/5.0 (Windows NT 6.1; rv:22.0) Gecko/20130405 Firefox/22.0";
/**
* Constructor sets up {@link $generate_enclosure}.
/**
* Constructor sets up {@link $generate_enclosure}.
@@
-77,7
+77,7
@@
class Tweeper {
CURLOPT_SSL_VERIFYHOST => FALSE,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_HTTPHEADER => array('Accept-language: en'),
CURLOPT_SSL_VERIFYHOST => FALSE,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_HTTPHEADER => array('Accept-language: en'),
- CURLOPT_USERAGENT => Tweeper::$
USER_AGENT
,
+ CURLOPT_USERAGENT => Tweeper::$
userAgent
,
));
$contents = curl_exec($ch);
curl_close($ch);
));
$contents = curl_exec($ch);
curl_close($ch);
@@
-98,7
+98,7
@@
class Tweeper {
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_SSL_VERIFYHOST => FALSE,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_SSL_VERIFYHOST => FALSE,
CURLOPT_SSL_VERIFYPEER => FALSE,
- CURLOPT_USERAGENT => Tweeper::$
USER_AGENT
,
+ CURLOPT_USERAGENT => Tweeper::$
userAgent
,
));
curl_exec($ch);
$url_info = curl_getinfo($ch);
));
curl_exec($ch);
$url_info = curl_getinfo($ch);
@@
-110,7
+110,7
@@
class Tweeper {
/**
* Generate an RSS <enclosure/> element.
*/
/**
* Generate an RSS <enclosure/> element.
*/
- public static function generate
_e
nclosure($url) {
+ public static function generate
E
nclosure($url) {
$supported_content_types = array(
"application/ogg",
"audio/aac",
$supported_content_types = array(
"application/ogg",
"audio/aac",
@@
-129,7
+129,7
@@
class Tweeper {
"video/ogg",
);
"video/ogg",
);
- // The RSS specification says that the enclosure element
url
must be http.
+ // The RSS specification says that the enclosure element
URL
must be http.
// See http://sourceforge.net/p/feedvalidator/bugs/72/
$http_url = preg_replace("/^https/", "http", $url);
// See http://sourceforge.net/p/feedvalidator/bugs/72/
$http_url = preg_replace("/^https/", "http", $url);
@@
-203,7
+203,7
@@
class Tweeper {
$xsltProcessor = new XSLTProcessor();
$xsltProcessor->registerPHPFunctions();
$xsltProcessor = new XSLTProcessor();
$xsltProcessor->registerPHPFunctions();
- $xsltProcessor->setParameter('', 'generate
E
nclosure', $this->generate_enclosure);
+ $xsltProcessor->setParameter('', 'generate
-e
nclosure', $this->generate_enclosure);
$xsltProcessor->importStylesheet($xslDoc);
return $xsltProcessor;
$xsltProcessor->importStylesheet($xslDoc);
return $xsltProcessor;
@@
-213,7
+213,7
@@
class Tweeper {
* Convert json to xml.
*/
private function json_to_xml($json, $root_node_name) {
* Convert json to xml.
*/
private function json_to_xml($json, $root_node_name) {
- // Apparenty the ObjectNormalizer used afterwards is not able to handle
+ // Apparent
l
y the ObjectNormalizer used afterwards is not able to handle
// the stdClass object created by json_decode() with the default setting
// $assoc = false; so use $assoc = true.
$data = json_decode($json, $assoc = TRUE);
// the stdClass object created by json_decode() with the default setting
// $assoc = false; so use $assoc = true.
$data = json_decode($json, $assoc = TRUE);
@@
-298,7
+298,7
@@
class Tweeper {
public function tweep($src_url) {
$url = parse_url($src_url);
if (FALSE === $url || empty($url["host"])) {
public function tweep($src_url) {
$url = parse_url($src_url);
if (FALSE === $url || empty($url["host"])) {
- trigger_error("Invalid
url
: $src_url", E_USER_ERROR);
+ trigger_error("Invalid
URL
: $src_url", E_USER_ERROR);
return NULL;
}
return NULL;
}