1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP RSS Parser

Discussion in 'Programming' started by Ian, Aug 7, 2005.

  1. #1
    Anyone have any simple PHP code to parse an RSS feed, most importantly one that allows you to both enable/disable descriptions and select the number of results to be shown? I can't seem to find one that works well and allows me to do this.

    Ian
     
    Ian, Aug 7, 2005 IP
  2. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #2
    There is magpie on sourceforge and Carp RSS by gecko tribe. There's also code for a php rss parser here in the forums that you can search for. I know Carp best myself, and it's very easy to enable/disable descriptions by just setting a variable before you output the feed.
     
    nevetS, Aug 7, 2005 IP
    Ian likes this.
  3. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #3
    dcristo, Aug 7, 2005 IP
    Ian likes this.
  4. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #4
    nevet, would u have any idea about my problem here:
    http://forums.digitalpoint.com/showthread.php?t=23851 ?
     
    dcristo, Aug 7, 2005 IP
  5. Ian

    Ian Well-Known Member

    Messages:
    409
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    125
    #5
    I tried that one, and it's a great script but I couldn't figure out how to set the number of items it returns. Do you have any insight on how to set that?

    Thanks in advance!

    Ian
     
    Ian, Aug 8, 2005 IP
  6. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #6
    That's actually one thing I did figure out...

    In the php code, include this line above the CarpCacheShow statement:

    CarpConf('maxitems',10);

    change the 10 to whatever you want to change the max items to.

    cheers
     
    dcristo, Aug 8, 2005 IP
  7. xstorm

    xstorm Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thanks for the info on carp. useful for me :)
     
    xstorm, Aug 8, 2005 IP
  8. WhatiFind

    WhatiFind offline

    Messages:
    1,789
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    180
    #8
    WhatiFind, Aug 8, 2005 IP
    Ian likes this.
  9. daed

    daed Peon

    Messages:
    93
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I've been using MagpieRSS lately, seems to do an awesome job so far.. and I love the caching.
     
    daed, Aug 18, 2005 IP
  10. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #10
    Even the big systems use Magpie, it's highly recommended
     
    sarahk, Aug 18, 2005 IP
  11. Josh

    Josh Peon

    Messages:
    893
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Josh, Aug 18, 2005 IP
  12. ferret77

    ferret77 Heretic

    Messages:
    5,276
    Likes Received:
    230
    Best Answers:
    0
    Trophy Points:
    0
    #12
    rss fetch

    allows you to set the number of results
     
    ferret77, Aug 18, 2005 IP
  13. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #13
    they all do that don't they?
     
    sarahk, Aug 18, 2005 IP
  14. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #14
    Pretty much... I know carp does.
     
    dcristo, Aug 18, 2005 IP
  15. daed

    daed Peon

    Messages:
    93
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Number of results? That can be done with 1 line of code in any programming language.
     
    daed, Aug 18, 2005 IP
  16. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #16
    we're all techies :rolleyes:
     
    dcristo, Aug 18, 2005 IP
  17. SpeedyDomainRegistration

    SpeedyDomainRegistration Peon

    Messages:
    170
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #17
  18. SiCK

    SiCK Peon

    Messages:
    452
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #18
    http://www.feedforall.com/free-php-script.htm

    I hacked it in 10 minutes and how do things like this:

    
    showrss('http://search.msn.com/results.aspx?='.$keywordplus.'&format=rss', '
    
                ~~~BeginItemsRecord~~~
    <A h ref="~~~ItemLink~~~">~~~ItemTitle~~~</A><br>
                ~~~ItemDescription~~~<BR>
                <p>
                ~~~EndItemsRecord~~~
    ',10);
    
    Code (markup):
    The 10 is the # of records to return

    If you are a newbie programmer in PHP, it might take longer than 10 minutes to get something useful from this.
     
    SiCK, Sep 2, 2005 IP
  19. odditysoftware

    odditysoftware Peon

    Messages:
    937
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #19
    magpie is the easiest to impliment from my experiences.
     
    odditysoftware, Sep 2, 2005 IP
  20. drvo

    drvo Guest

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    I need help on MAGPIE installation, how to implement and integrate in the easiest way to some web page? Is there some easy tutorial for it ?

    Thank you
     
    drvo, Mar 5, 2007 IP