Absolutely clueless with a function

Discussion in 'PHP' started by crazyryan, Feb 15, 2008.

  1. #1
    Hey

    I want to write a function that grabs the 1st meaning from urbandictionary, although the preg_match stuff and regex totally confuses me.

    function urbandictionary($keyword) {
        
    }
    PHP:
    Is what I have so far, eventually I want to be able to do like, urbandictionary($_POST['keyword']), so I think what I have so far is on the right tracks.

    Can anyone help me with grabbing the 1st definition, if one exists.

    Thanks!
     
    crazyryan, Feb 15, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Doesn't sound legal to me. Do you have their permission to grab their content and put it on your site?
     
    nico_swd, Feb 15, 2008 IP
  3. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #3
    Nope, don't have their permission.

    I was just about to read their TOS but it seems they have an API that allows data to be grabbed so I'll look into that.

    EDIT: Bah, their API documentation site is down atm.
     
    crazyryan, Feb 15, 2008 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    I requested the API license key... I'll get on it as soon as their WIKI is up again.
     
    nico_swd, Feb 15, 2008 IP
  5. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #5
    I tried looking to see if google had the documentation cached but they don't for PHP.
     
    crazyryan, Feb 15, 2008 IP
  6. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yeah, I'm pretty sure that API documentation is for other programming languages (most likely C, Java, possibly even VB).
     
    zerxer, Feb 15, 2008 IP