[RC][1.1.0-r2] FIND

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Ideas Centre
tracer70
Registered User
Posts: 17
Joined: Sun May 25, 2008 10:14 am
Name: Micha Espey

Re: [DEV] RSS Input

Post by tracer70 »

MrGroove wrote: 1 - Each item in RSS Feed should create new Topic
2 - New topic should be named the Subject line of each RSS Feed Item
3 - New Topic should not include Item Subject inside Topic body
4 - New Topic should not include Last Updated data inside Topic Body

Make sense?
Points 1 and 2 are part of the codechanges you quoted above.

Have a look her: http://www.rc-heli-fan.org/viewforum.php?f=250

btw, if someones interested, my modified version of rss_import.php, I call it via php cli.

Code: Select all

<?php
/**
*
* FIND - Atom/RSS import
*
* @package rss_import
* @version 0.2r3
* @copyright (c) 2008, 2009 PoPoutdoor
* @license	http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Do not update users last page entry
$user->session_begin(false);
$user->setup('common');
$user->add_lang('mods/find');

// check if parameter there
if ($argc != 2)
{
	die("no or wrong parameters!\n");
}

// get feed posted
include($phpbb_root_path . 'includes/rss_parser.'.$phpEx);
include($phpbb_root_path . 'includes/functions_find.'.$phpEx);

$feed = $argv[1];
$feed = preg_replace('/[^0-9,]/', '', $feed);

$ary = explode(",", $feed);
if (sizeof($ary))
{
	$ary = array_diff($ary, array('' => 0), array('' => ''));
	$ary = array_unique($ary);
	$ids = implode(",", $ary);
}
else
{
	$ids = ($feed) ? $feed : '';
}
if (empty($ids))
{
	die($user->lang['NO_IDS']);
}
$ret = get_rss_content($ids);
?>
dmacleo
Registered User
Posts: 10
Joined: Mon Jan 18, 2010 7:34 pm

Re: [DEV] RSS Input

Post by dmacleo »

installed ok, feed added ok, but nothing happens.
I'm not sure on the scheduling can someone please advise?

running on site5 linux server.
.
User avatar
PoPoutdoor
Registered User
Posts: 217
Joined: Fri Oct 31, 2008 2:58 pm

Re: [DEV] RSS Input

Post by PoPoutdoor »

For those having problems without my reply, please read post #2 first!

If you don't gave out required info or you haven't tried something to help yourself first.
My free time slots is mainly on coding of next version and IFF any time left, limited support here until Feb.
User avatar
rabbmasterflash
Registered User
Posts: 35
Joined: Wed Dec 16, 2009 2:23 pm
Location: Colorado

Re: [DEV] RSS Input

Post by rabbmasterflash »

I installed it but I am also not able to get it to actually post anything after following all of the steps. The feed is good, the bot is there.

I have a feeling I am just not setting my CRON job correctly, I have

Code: Select all

GET http://www.tailgate365.com/forum/rss_import.php?feed=n
as my CRON job.

Any tips are appreciated
tracer70
Registered User
Posts: 17
Joined: Sun May 25, 2008 10:14 am
Name: Micha Espey

Re: [DEV] RSS Input

Post by tracer70 »

rabbmasterflash wrote:I installed it but I am also not able to get it to actually post anything after following all of the steps. The feed is good, the bot is there.

I have a feeling I am just not setting my CRON job correctly, I have

Code: Select all

GET http://www.tailgate365.com/forum/rss_import.php?feed=n
as my CRON job.

Any tips are appreciated
I don't know what this GET should be.

Try my version (postet above) and call it via

php /path/to/the/scipt/rss_import feed=1,2, for 2 feeds.

Just works.
dmacleo
Registered User
Posts: 10
Joined: Mon Jan 18, 2010 7:34 pm

Re: [DEV] RSS Input

Post by dmacleo »

think I made error on my cron path, going to verify that.
User avatar
rabbmasterflash
Registered User
Posts: 35
Joined: Wed Dec 16, 2009 2:23 pm
Location: Colorado

Re: [DEV] RSS Input

Post by rabbmasterflash »

ok, I changed mine to

Code: Select all

php http://www.tailgate365.com/forum/rss_import.php?feed=1
and am testing

one stupid question, will it only pick up new items on the feed or will it take the last x posts I defined in the ACP?
dmacleo
Registered User
Posts: 10
Joined: Mon Jan 18, 2010 7:34 pm

Re: [DEV] RSS Input

Post by dmacleo »

I am good right up to this point:
# Secure rss_import.php

1. Un-comment // Check the User-Agent and // Additional check if you're worired about being attacked code block in rss_import.php. You must comment every die(); and un-comment die($user->lang['HACK_ATTEMPT']); to get the error message.
2. Login web server terminal and type GET http://your.site.tld/rss_import.php?feed=n. If you don't have terminal access, set a CRON job 2 minutes ahead and check if any email received after timeout.
3. If the feed source can be access, you do not get any messages. If you got error, look in the apache log first. The possible error will be related to the User-Agent, you can check this out and edit the User-Agent code to fix.
4. You will get "Suspected hack attempts detected." in both cases:
* Open http://your.site.tld/rss_import.php?feed=n with browser
* Type GET http://your.site.tld/rss_import.php?feed=n in terminal
from remote site. If you don't get this message, please report here!
5. Undo the edits about die()
6. Recommendations:

* The default will be OK for dedicated web servers with own IP.
Possible DOS attack will be handled by phpbb core code.
* If your CRON job runs in the same server and same IP, enable the // Check the User-Agent code block.
This prevents running RSS Import code other than from the web server IP with "GET" or "curl" user-agent, this will be sufficient to prevent most DOS attack outside your server.
* If your web server doesn't have dedicated IP or IP shared with other sites, change rss_import.php to somethingelse.php.
By changing the filename to what others can't guess easily, should prevent possible DOS attack from any IPs. Remember to update your CRON job for the filename changes.

# Schedule auto posting for timed feed import
Note: The auto posting script should works with most OS' scheduler, with system PERL installed. Since my own computers only have Gentoo Linux installed, so the following only valid for Linux, may not applied to other OSes ;) The path depends on your distro and which cron program used, please adjust to what the system installed.
.
1: Un-comment // Check the User-Agent I do this no matter what correct? and removing the // does uncomment it correct?
I am not worried about attacks so that should be all I need to do to the file correct? I do have my own IP.

2. Login web server terminal and type GET http://your.site.tld/rss_import.php?feed=n
does the n actually get typed or is that an acronym for the feed name we've assigned to a feed in the ACP?
User avatar
rabbmasterflash
Registered User
Posts: 35
Joined: Wed Dec 16, 2009 2:23 pm
Location: Colorado

Re: [DEV] RSS Input

Post by rabbmasterflash »

well I got a little further, now I get a 404 error when the CRON job fails
User avatar
rabbmasterflash
Registered User
Posts: 35
Joined: Wed Dec 16, 2009 2:23 pm
Location: Colorado

Re: [DEV] RSS Input

Post by rabbmasterflash »

Well now the CRON job is not failing, but I think I might have it set wrong still for this

I replaced the rss_import.php with the one posted here, but I am still thinking my CRON job is not right for it

any tips anyone can offer would be great
tracer70
Registered User
Posts: 17
Joined: Sun May 25, 2008 10:14 am
Name: Micha Espey

Re: [DEV] RSS Input

Post by tracer70 »

You need php cli for my version.

Log into your server, execute:

Code: Select all

www-data@www:~$ php rss_import.php feed=1,2
If that works, try a crontab like this:

Code: Select all

0 * * * * php /var/www/rss_import.php feed=1,2
User avatar
rabbmasterflash
Registered User
Posts: 35
Joined: Wed Dec 16, 2009 2:23 pm
Location: Colorado

Re: [DEV] RSS Input

Post by rabbmasterflash »

not sure if I have php cli or not
tracer70
Registered User
Posts: 17
Joined: Sun May 25, 2008 10:14 am
Name: Micha Espey

Re: [DEV] RSS Input

Post by tracer70 »

Do you have root access?
User avatar
rabbmasterflash
Registered User
Posts: 35
Joined: Wed Dec 16, 2009 2:23 pm
Location: Colorado

Re: [DEV] RSS Input

Post by rabbmasterflash »

unfortunately, I only have cpanel access to our web site
tracer70
Registered User
Posts: 17
Joined: Sun May 25, 2008 10:14 am
Name: Micha Espey

Re: [DEV] RSS Input

Post by tracer70 »

rabbmasterflash wrote:unfortunately, I only have cpanel access to our web site
Sorry, than I can't help you :(

Return to “[3.0.x] MODs in Development”