I fix it! Dont know if its the right way but it works. Im not a
programmer but just for curiosity i try the lines on util.php and this
line
"http://bit.ly/api?method=shorten&long_url=http://google.com"
gives this error
"{ "errorCode": 203, "errorMessage": "You must be authenticated to
access shorten", "statusCode": "ERROR" }"
So i look into bit.ly api docs and found the new code with user and
api key. I created an account for my status.net site and changed the
lines in util.php in this way:
case 'bit.ly':
curl_setopt($curlh, CURLOPT_URL, 'http://api.bit.ly/shorten?
version
=2.0.1&login=MYUSERNAME&apiKey=MY_BIT.LY_API_KEY&longUrl='.urlencode
($long_url));
$short_url = current(json_decode(curl_exec($curlh))->results)-
>shortUrl;
break;
Also changed the result hashUrl for the right one shortUrl.
I think the best way is if every use can specify his bit.ly username
and api key.
Thanks
Cristian
El 15/10/2009, a las 00:33, Cristian Beckerle escribió:
Hello!
I got this problem only if i set bit.ly as shorten service in my
profile. I cant attach anything. I dont get errors on the browser,
the file is uploaded ok in /files/ but the notice is not posted at
all. Then if i check on apache logs i got this:
[Wed Oct 14 21:19:03 2009] [error] [client 190.9.9.85] PHP Warning:
current() [<a href='function.current'>function.current</a>]: Passed
variable is not an array or object in /home/pipio/public_html/lib/
util.php on line 1392, referer: http://pipio.com.ar/
[Wed Oct 14 21:19:03 2009] [error] [client 190.9.9.85] PHP Warning:
Cannot modify header information - headers already sent by (output
started at /home/pipio/public_html/lib/util.php:1392) in /home/pipio/
public_html/lib/htmloutputter.php on line 109, referer: http://pipio.com.ar/
[Wed Oct 14 21:19:03 2009] [error] [client 190.9.9.85] PHP Warning:
Cannot modify header information - headers already sent by (output
started at /home/pipio/public_html/lib/util.php:1392) in /home/pipio/
public_html/lib/error.php on line 73, referer: http://pipio.com.ar/
Lines in util.php
1390 case 'bit.ly':
1391 curl_setopt($curlh, CURLOPT_URL, 'http://bit.ly/api?
method=shorten&long_url='.urlencode($long_url));
1392 $short_url = current(json_decode(curl_exec($curlh))-
>results)->hashUrl;
1393 break;
Can i have something wrong in my server?
Thanks
Cristian
_______________________________________________
StatusNet-dev mailing list
StatusNet-dev@lists.status.net
http://lists.status.net/mailman/listinfo/statusnet-dev
_______________________________________________
StatusNet-dev mailing list
StatusNet-dev@lists.status.net
http://lists.status.net/mailman/listinfo/statusnet-dev