*/
function asString()
{
- $this->doc['generator'] = 'StatusNet ' . STATUSNET_VERSION; // extension
+ $this->doc['generator'] = 'GNU social ' . GNUSOCIAL_VERSION; // extension
$this->doc['title'] = $this->title;
$this->doc['url'] = $this->url;
$this->doc['totalItems'] = $this->count;
}
parent::__construct($url, $method, $config);
- $this->setHeader('User-Agent', $this->userAgent());
+ $this->setHeader('User-Agent', self::userAgent());
}
/**
*
* @return string
*/
- function userAgent()
+ static public function userAgent()
{
- return "GNU Social/".GNUSOCIAL_VERSION." (".GNUSOCIAL_CODENAME.")";
+ return GNUSOCIAL_ENGINE . '/' . GNUSOCIAL_VERSION
+ . ' (' . GNUSOCIAL_CODENAME . ')';
}
/**
if ($type === 'get') {
$result = $fetcher->get($notify_url . '?' . http_build_query($args),
- array('User-Agent: StatusNet/'.STATUSNET_VERSION));
+ array('User-Agent: ' . HTTPClient::userAgent()));
} else {
$result = $fetcher->post($notify_url,
http_build_query($args),
- array('User-Agent: StatusNet/'.STATUSNET_VERSION));
+ array('User-Agent: ' . HTTPClient::userAgent()));
}
if ($result->status != '200') {
common_log(LOG_WARNING,
$this->log(LOG_DEBUG, $msg);
}
- function name()
+ public function name()
{
$cls = get_class($this);
return mb_substr($cls, 0, -6);
}
+ public function version()
+ {
+ return GNUSOCIAL_VERSION;
+ }
+
+ protected function userAgent() {
+ return HTTPClient::userAgent()
+ . ' (' . get_class($this) . ' v' . $this->version() . ')';
+ }
+
function onPluginVersion(&$versions)
{
$name = $this->name();
return '127.0.0.1';
}
- function userAgent()
+ function version()
{
- return 'BlogspamNetPlugin/'.BLOGSPAMNETPLUGIN_VERSION . ' StatusNet/' . STATUSNET_VERSION;
+ return BLOGSPAMNETPLUGIN_VERSION;
}
function onPluginVersion(&$versions)
}
}
- function userAgent()
+ public function version()
{
- return 'LinkbackPlugin/'.LINKBACKPLUGIN_VERSION .
- ' StatusNet/' . STATUSNET_VERSION;
+ return LINKBACKPLUGIN_VERSION;
}
function onPluginVersion(&$versions)
return true;
}
- function userAgent()
- {
- return 'SpotifyPlugin/'.SPOTIFYPLUGIN_VERSION .
- ' StatusNet/' . STATUSNET_VERSION;
- }
-
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'Spotify',
$lines = array(
"GET $path HTTP/1.1",
"Host: $host",
- "User-Agent: StatusNet/" . STATUSNET_VERSION . " (TwitterBridgePlugin)",
+ 'User-Agent: ' . HTTPClient::userAgent() . ' (TwitterBridgePlugin)',
"Connection: close",
"",
""