function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'WikiHow avatar fetcher',
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'WikiHow avatar fetcher',
'author' => 'Brion Vibber',
'homepage' => 'http://status.net/wiki/Plugin:Sample',
'rawdescription' =>
'author' => 'Brion Vibber',
'homepage' => 'http://status.net/wiki/Plugin:Sample',
'rawdescription' =>
$client = HTTPClient::start();
$response = $client->get($profileUrl);
if (!$response->isOk()) {
$client = HTTPClient::start();
$response = $client->get($profileUrl);
if (!$response->isOk()) {
private function saveAvatar($user, $url)
{
if (!common_valid_http_url($url)) {
private function saveAvatar($user, $url)
{
if (!common_valid_http_url($url)) {
- throw new ServerException(sprintf(_m("Invalid avatar URL %s."), $url));
+ // TRANS: Server exception thrown when an avatar URL is invalid.
+ // TRANS: %s is the invalid avatar URL.
+ throw new ServerException(sprintf(_m('Invalid avatar URL %s.'), $url));
// ripped from OStatus via oauthstore.php (for old OMB client)
$temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
try {
if (!copy($url, $temp_filename)) {
// ripped from OStatus via oauthstore.php (for old OMB client)
$temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
try {
if (!copy($url, $temp_filename)) {
- throw new ServerException(sprintf(_m("Unable to fetch avatar from %s."), $url));
+ // TRANS: Exception thrown when fetching an avatar from a URL fails.
+ // TRANS: %s is a URL.
+ throw new ServerException(sprintf(_m('Unable to fetch avatar from %s.'), $url));