← Back to team overview

libsurl team mailing list archive

Re: Python function?

 

I don't know how python's C-interface works yet, but: for version 0.6,
the libsurl API is going to include functions along the lines of
(details to be worked out later)

char *surl_qshort(char *url) // picks a few services, and picks the
shortest resulting URL
char *surl_easy_shorten(char *service, char *url); // for normal people
char *surl_do_shorten(char *service,char *url,char *key,char
*whatever_else) // as specified above.

Any other suggestions?

I plan to have surl using the libsurl API around version 0.8 (of both
- version numbers roughly correspond as of libsurl-0.5).


On 12/25/09, Ahmed Elmahdawy <aa_mahdawy@xxxxxxxxxxx> wrote:
> Looking at libsurl's source code, I've found that it seems almost
> impossible for Python's -- or in this case, surl -- CDLL to call it.
> What can be done in the future is to implement a simple function that
> takes all arguments (url, api key, etc and null for none) and returns
> the shortened API.
> Here's an example:
>
> char *surl_pyget(char *url, char *service, char *key, /more args/)
> {
> /// do surl_getopt()'s, null or empty string=ignore/
>      char *shortUrl = /shortened url/;
>      // /cleanup/
>      return shortUrl;
> }
>
> Regards,
> Ahmed Elmahdawy
>


-- 
Scott Lawrence

Webmaster
The Blair Robot Project
Montgomery Blair High School



Follow ups

References