API question related to Thor's post Oct 6th

2 views
Skip to first unread message

Brendan

unread,
Dec 28, 2008, 7:42:12 AM12/28/08
to Cli.gs Interested
Just wondered if Thor's problem raised in emails over Oct 6th -7th was
solved. I took a similar php route and seem to be having the same
problem of the clig not being added to My Cligs in my account?

Pierre Far

unread,
Dec 28, 2008, 8:43:41 AM12/28/08
to Cli.gs Interested
Yes it was.

Please post the details of your problem and I'll take a look. We'll
need to check the code to make sure it's working well and I'll check
the API log to see what's going on.

Thanks,
Pierre

Brendan

unread,
Dec 28, 2008, 10:05:25 AM12/28/08
to Cli.gs Interested
Hi Pierre,

The bit of the script is:

<?php
$url = $_GET['url'];
$title = $_GET['title'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://cli.gs/api/v1/cligs/create?url=".
$url."&title=".$title ."&key=apikey&appid=apptitle");
$output = curl_exec($ch);
curl_close($ch);
?>

It creates the clig OK e.g. http://cli.gs/E24WNb but isn't attributing
to my cligs account.

Cheers,

Brendan

Pierre Far

unread,
Dec 28, 2008, 12:06:37 PM12/28/08
to Cli.gs Interested
Hi Brendan

The logs show that the request that created that clig was as follows:

http://cli.gs/api/v1/cligs/create?url=http://malleablemusings.wordpress.com/2008/12/22/cligs-and-the-iphone/&title=Cli.gs

The parameters were correctly parsed:
URL: http://malleablemusings.wordpress.com/2008/12/22/cligs-and-the-iphone/
Title: Cli.gs

Notice the lack anything after the title, which means that it created
a public clig. I've seen this kind of behavior/bug in PHP a few times.

My suggestion is to rework you code as follows:

curl_setopt($ch, CURLOPT_URL, "http://cli.gs/api/v1/cligs/create?
key=apikey&appid=apptitle&url=".
$url."&title=".$title);

This has fixed such issues before. Let me know how that works out for
you.

While you're at it, make sure that the title and the URL are urlencode
()ed.

Cheers,
Pierre

On Dec 28, 3:05 pm, Brendan <fawcet...@googlemail.com> wrote:
> Hi Pierre,
>
> The bit of the script is:
>
> <?php
> $url = $_GET['url'];
> $title = $_GET['title'];
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_HEADER, 0);
> curl_setopt($ch, CURLOPT_VERBOSE, 0);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_URL, "http://cli.gs/api/v1/cligs/create?url=".
> $url."&title=".$title ."&key=apikey&appid=apptitle");
> $output = curl_exec($ch);
> curl_close($ch);
> ?>
>
> It creates the clig OK e.g.http://cli.gs/E24WNbbut isn't attributing

Thor Erik

unread,
Jan 9, 2009, 7:41:38 AM1/9/09
to Cli.gs Interested
I fixed my issue doing like Pierre said, passing the api key and appid
first

On Dec 28 2008, 6:06 pm, Pierre Far <pierre...@gmail.com> wrote:
> Hi Brendan
>
> The logs show that the request that created that clig was as follows:
>
> http://cli.gs/api/v1/cligs/create?url=http://malleablemusings.wordpre...
> > It creates the clig OK e.g.http://cli.gs/E24WNbbutisn't attributing

Paulo Querido

unread,
Jan 9, 2009, 1:13:49 PM1/9/09
to Thor Erik, Cli.gs Interested
Ei, thanks!

It worked for me too. Great.




Thor Erik escreveu:
--
Paulo Querido
correio: paulo....@gmail.com
blog:
Mas certamente que sim!
<http://feeds.feedburner.com/%7Er/MasCertamenteQueSim/%7E6/5>
Reply all
Reply to author
Forward
0 new messages