I need a quick advice - Reward offered ;)

Discussion in 'PHP' started by maineexista, Nov 8, 2010.

  1. #1
    hi,

    i want a quick advice on how to extract Meta informations (title, description and keywords) from an external link on this page: www.consultanta-seo.ro/results/www.consultanta-seo.ro <- note: this url is changing, everytime someone is checking their website

    i found this: www.php.net/manual/en/function.get-meta-tags.php but i'm not very sure how to use it :)

    any help is appreciated, in exchange i will provide a strong backlink from a PR3 Web directoy with 5000+ indexed pages in yahoo, and growing;)


    Thank you for your time,
    P.S. if you need more infos, please PM me.
     
    maineexista, Nov 8, 2010 IP
  2. KingOle

    KingOle Peon

    Messages:
    69
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Example from PHP.net

    
    // Assuming the above tags are at www.example.com
    $tags = get_meta_tags('http://www.example.com/');
    
    // Notice how the keys are all lowercase now, and
    // how . was replaced by _ in the key.
    echo $tags['author'];       // name
    echo $tags['keywords'];     // php documentation
    echo $tags['description'];  // a php manual
    echo $tags['geo_position']; // 49.33;-86.59
    
    PHP:
     
    KingOle, Nov 8, 2010 IP
  3. Tastyweb

    Tastyweb Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The example code on the php function you mentioned is probably a good starting point :

    - just replace the URL with the address you're grabbing meta info from, and the information gets populated into the variable you specify ($tags in the example) as an array. Hope this helps :)
     
    Tastyweb, Nov 8, 2010 IP
  4. maineexista

    maineexista Peon

    Messages:
    317
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i've tried all these combinations, no results

    It's ok, i will go to someone i know to fix it, but i was hoping for a quicker help.


    Thanks again for your time
     
    maineexista, Nov 8, 2010 IP
  5. maineexista

    maineexista Peon

    Messages:
    317
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    anyone interested to give a shot ?

    i am willing to do anything what it takes to fix this crap

    thank you for your time
     
    maineexista, Nov 12, 2010 IP
  6. arpit13

    arpit13 Well-Known Member

    Messages:
    294
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #6
    if u know a bit about php its easy.
    
    $to_add=$_GET['s']; //in the url to the end of it add ?s="www.example.com"
    $tag=get_meta_tags("www.consultanta-seo.ro/result/$to_add"); //got the meta info and arranged it in the array.
    echo $tag['description']; //this will output the "values" in meta tag "named" "description"
    
    PHP:
    hope it helps.
     
    arpit13, Nov 12, 2010 IP
  7. tnd8

    tnd8 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    2 ways for u:

    1. get_meta_tags(url); it's very easy.

    2. try using preg_math

    
    $content = file_get_contents('example.com');
    preg_match('@<title>[\s\n]*(.*?)[\s\n]*</title>@si', $content, $matches);
    echo $matches[1];  //title
    
    PHP:
     
    tnd8, Nov 12, 2010 IP
  8. maineexista

    maineexista Peon

    Messages:
    317
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    i will try both codes, if anything works, i will contact you for your link's details ;)

    Chers!
     
    maineexista, Nov 14, 2010 IP
  9. maineexista

    maineexista Peon

    Messages:
    317
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    nothing worked! :(

    If someone is willing to give me a hand, i can send the entire html code to try it out.

    keep in mind, i will return a strong backlink for this job ;)
     
    maineexista, Nov 21, 2010 IP