Take information from other page and move it to your page

Discussion in 'Programming' started by blabla11, Nov 3, 2006.

  1. #1
    How would I take information let's say number of threads on digitalpoint and show it on my website.
    Information must be updated. Numbers must alway be the same.

    Is it possible to do this?
     
    blabla11, Nov 3, 2006 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Possible, yes. Allowed, no.

    RSS would be easiest, otherwise try PHP's file_get_contents() or curl.
     
    T0PS3O, Nov 3, 2006 IP
  3. blabla11

    blabla11 Peon

    Messages:
    164
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Why not allowed?
    In thing I'm thinking about I would also bring visitors to DP (acctualy not DP, but let's say it is DP)
     
    blabla11, Nov 3, 2006 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Because you're not allowed to steal content.

    Exceptions are if they allow it in their Terms & Conditions or you get written permission.
     
    T0PS3O, Nov 3, 2006 IP
  5. blabla11

    blabla11 Peon

    Messages:
    164
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ok, I think they would allow this.

    So how exacly i get this information into my website. I'm not good with php.
    It would be good enough if it would update every 10minutes, but faster is better.

    Thanks!
     
    blabla11, Nov 3, 2006 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    Here an example for your first question.
    
    <?php
    
    $data = file_get_contents('http://forums.digitalpoint.com');
    
    preg_match('/Threads: ([0-9,]{6,8})\,/', $data, $matches);
    
    echo 'There are currently '. $matches[1] .' threads on digitalpoint.';
    
    ?>
    
    Code (markup):
    The better you are with regular expressions, the easier it will be to fetch the content you want.
     
    nico_swd, Nov 3, 2006 IP
    YIAM and blabla11 like this.
  7. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You need to search for a script to parse RSS feeds.
     
    mad4, Nov 3, 2006 IP
  8. blabla11

    blabla11 Peon

    Messages:
    164
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    it's working, thanks
     
    blabla11, Nov 3, 2006 IP
  9. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #9
    Nice Script, if it's working. I have saved it in my notepad for future use.
     
    YIAM, Nov 3, 2006 IP