How to display an external website?

Discussion in 'PHP' started by sorupcikacam, Oct 25, 2008.

  1. #1
    hi all. i am a newbie here and sorry for my bad english. here i'll try to explain my question:

    there is a "digg" style website which i want to retrieve the list of topics on a particular day from. for example everyday people are posting something on that website.

    now my question is:

    for example i want to display the list of the topics on 23 October 2007 on my website. i want to allow users select the date and click to button to display the topics. how can i do this? Can you please give me some ideas?

    this is how url looks like:

    http://???.com/index.php?day=1&month=1&year=2007

    Thanks
     
    sorupcikacam, Oct 25, 2008 IP
  2. Tarkan

    Tarkan Peon

    Messages:
    491
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Using fsockopen I believe you can connect to the website, then read it's html, interpret the area you want. You may find some separator to explode(). Then you explode() the topics.

    Of course the easier way is to use a feed reading code. I'm sure digg has feeds.
     
    Tarkan, Oct 25, 2008 IP
  3. sorupcikacam

    sorupcikacam Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Tarkan.

    now this code works for me. it displays the topics on current day.

    <?php

    $currentday=date(j);
    $currentmonth=date(n);
    $currentyear=date(Y);

    echo("<br><br>today's popular topics on website XXX are: <br><br>");

    echo"<IFRAME src=\"http://websiteXXX.com/index.php?day=$currentday&month=$currentmonth&year=$currentyear\" width=\"240\" height=\"800\">"
    . "<p>sorry your browser does not support frames.</p>"
    . "</IFRAME>";

    ?>

    but how can i include a date combo so users can select day, month and year and then they can retrieve the topics from that date? which function should i have to use? can you please be more specific.

    Thank you very much.
     
    sorupcikacam, Oct 26, 2008 IP
  4. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    shouldn't that be

    $currentday=date("j");
    $currentmonth=date("n");
    $currentyear=date("Y");
     
    Kyosys, Oct 26, 2008 IP