Page 2 of 19 FirstFirst 123412 ... LastLast
Results 11 to 20 of 190
  1. #11
    dwg
    dwg is offline
    New Pligger dwg's Avatar
    Joined
    Mar 2006
    Posts
    18
    Thanks
    Received:0
    Given: 0
    Using Magpierss, here is something quick and dirty that seems to work for me. Not sure how to get the tags inserted, but the rest should work. Just set it up as a cron.

    Code:
    <?
    require('../magpierss/rss_fetch.inc');
    
    include('config.php');
    require(mnminclude.'link.php');
    
    $rss_feeds=array (
            array(
                    'url'=>"http://digg.com/rss/index.xml",
                    'category'=>7,
                    'author'=>16,
    //              'tags'=>'
            ),
    );
    
    
    echo "<ul>\n";
    foreach ($rss_feeds as $feed ) {
    $rss = fetch_rss($feed['url']);
    echo "<li>Site: ", $rss->channel['title'], "<br>\n";
    foreach ($rss->items as $item ) {
            $item['author']=$feed['author'];
            $item['category']=$feed['category'];
     
            $title = $item[title];
            $desc= $item[description];
    
            echo "<ul>";
            echo "<li>Processing <a href=$url>$title</a></li>\n";
            rss_store($item);
            echo "<li>Finished Processing <a href=$url>$title</a></li><br><br/>\n\n";
            echo "</ul>";
    
    }
    
    echo "</li>";
    }
    echo "</ul>";
    
    
    function rss_store($item) {
    
            $linkres=new Link;
    
            $edit = false;
            $linkres->get(trim($item['link']));
    
            if(!$linkres->valid) {
                    rss_error($item['link']);
                    return;
            }
    
            if($linkres->duplicates($item['link']) > 0) {
                    rss_error($item['url']);
                    return;
            }
            $linkres->status='discard';
            $linkres->author=$item['author'];
    
            $linkres->title=$item['title'];
            $linkres->content=$item['description'];
    
    
            $linkres->id=0;
            $linkres->category=$item['category'];
            $linkres->randkey=rand(10000,10000000);
            $linkres->read();
            $linkres->status='queued';
            $linkres->store();
            return;
    }
    
    function rss_error($url){
            echo "Skipped $url <br/>\n";
    }
    
    
    ?>

  2. #12
    New Pligger johnchandler's Avatar
    Joined
    Mar 2006
    Posts
    18
    Thanks
    Received:0
    Given: 0
    So I can just name this script whatever I want, change the rss feed source, and run it as a cron?

  3. #13
    dwg
    dwg is offline
    New Pligger dwg's Avatar
    Joined
    Mar 2006
    Posts
    18
    Thanks
    Received:0
    Given: 0
    Yep...although you should have your cron have something like ' >/dev/null 2>&1' at the end so it doesn't capture any of the output. You can add as many rss feed sources as you want, just add an additional array to $rss_feeds.

  4. #14
    Casual Pligger Xanatos's Avatar
    Joined
    Jan 2006
    Posts
    31
    Thanks
    Received:0
    Given: 0
    nice job dwg
    but i want to ask how to set a cron job in Magpie?

  5. #15
    New Pligger user008's Avatar
    Joined
    Apr 2006
    Posts
    1
    Thanks
    Received:0
    Given: 0

    Running PHP Scripts with Cron

    Xanatos.. Cron is normally available on all Unix and Linux distributions. Here is a nice tutorial about running PHP scripts with Cron

    http://www.htmlcenter.com/tutorials/...s.cfm/155/PHP/

  6. #16
    Casual Pligger Xanatos's Avatar
    Joined
    Jan 2006
    Posts
    31
    Thanks
    Received:0
    Given: 0
    sorry user008 i still dont understanding how to set cron job
    could anyone teach me step by step??

  7. #17
    Casual Pligger Xanatos's Avatar
    Joined
    Jan 2006
    Posts
    31
    Thanks
    Received:0
    Given: 0
    i think i know how to set a cron job now
    thx user008

  8. #18
    Constant Pligger cryptkeeper's Avatar
    Joined
    Jan 2006
    Posts
    191
    Thanks
    Received:0
    Given: 0
    DWG, with your method, what shows up as the poster?

  9. #19
    dwg
    dwg is offline
    New Pligger dwg's Avatar
    Joined
    Mar 2006
    Posts
    18
    Thanks
    Received:0
    Given: 0
    The poster is whoever's author id you set in the settings for the RSS feed:

    $rss_feeds=array (
    array(
    'url'=>"http://digg.com/rss/index.xml",
    'category'=>7,
    'author'=>16,
    // 'tags'=>'
    ),
    );

    So, for the above, whichever user has the id=16 is considered the author.

  10. #20
    New Pligger RBasil's Avatar
    Joined
    Apr 2006
    Posts
    15
    Thanks
    Received:0
    Given: 0
    dwg,

    Your mod is working great for some feeds and not others. For example:

    Works:
    http://rss.teamxbox.com/news/xbox-360.rss

    Does not work:
    http://scripts.gamespy.com/rss/gamespy.PC.2.0.xml

    I don't get any error messages on the non working feed. Just a blank page when I send the feed through your mod.

    Any ideas?

Page 2 of 19 FirstFirst 123412 ... LastLast

Similar Threads

  1. Automatically Submit Posts
    By PliggUserz in forum Questions & Comments
    Replies: 3
    Last Post: 12-20-2010, 02:15 PM
  2. [SOLVED] How to automatically check for updates in rss feed?
    By marcinpl87 in forum Questions & Comments
    Replies: 3
    Last Post: 01-13-2010, 09:06 PM
  3. Import RSS Auto submit feed
    By argh2xxx in forum Questions & Comments
    Replies: 12
    Last Post: 09-12-2007, 01:02 PM
  4. [Fixed] Import RSS feed not update automatically
    By smart in forum Questions & Comments
    Replies: 11
    Last Post: 03-06-2007, 09:36 AM
  5. Sugg: Submit your feed
    By MazZziKa in forum Questions & Comments
    Replies: 0
    Last Post: 12-09-2006, 03:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg