SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2011
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using goo.gl url shortener [Help modifying shortener for bit.ly]

    Hi, so as some of you will know i have a file upload site that outputs bit.ly links.

    Code:
    $contents = file_get_contents("http://api.bit.ly/v3/shorten?login=andre1990&apiKey=R_56a95c84d089129012516e24806c3649&longUrl=".urlencode($final)."&format=txt");
    echoing it out as:

    <input type="text" size="10" onClick=select() value="<?php echo $contents;?>" READONLY><p />

    Now i want to use goo.gl instead now, any help? Ive got an api key.

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2011
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any help at all?

    I think goo.gl uses curl command, but i wanted to just adapt my current code rather than start again.

  3. #3
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,397
    Mentioned
    61 Post(s)
    Tagged
    0 Thread(s)
    This may be a silly question, but have you read through the documentation about the url shortener? It details everything that you will have to do (and how to do it) and provides code samples for using with PHP (and lots of other languages).
    Salathe
    Software Developer and PHP Manual Author.

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2011
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not a silly question...i have had a look through and wasn't able to decipher what a single piece of code would look like that would get the job done.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •