RSS Feed Poster

Started by SMFHacks.com Team, January 11, 2007, 07:46:04 PM

Previous topic - Next topic

KahneFan

I searched through and did not see this question. Sorry if has been asked/answered.

If you view My Forum you will see that my feeds give results with the same title, but different body...

This is a title
- body abc

and then it will update with...

This is a title
- body bcd

Is there anyway that a) body bcd can replace body abc if the titles are the same, or b) body abd will be merged/added to abc if the title matches? I hope this makes sense. I'm ending up with multiple threads titled the same, only difference is a line changed.

For example, see This Thread and you will see cowboys @ broncos is listed 3 times. The only difference is 1->2 spread changed, 2->3 it was given a money line. But if I receive responses to post 1, I don't want people to start posting on 2 or 3. If 2 was added (inline) to 1 and 3 added (inline) to 2, it would fall in line with discussion that may be posted. OR, if the body of 1 was replaced by 2 and body 2 was replaced by 3, the responses could remain intact as well.

Any help is appreciated.
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

vbgamer45

Not currently part of this mod.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

kandalf

Quote from: vbgamer45 on August 12, 2008, 07:53:01 PM
Just change the feed tables to utf8

What are the tables that I have to change?

Now the feedbot only write 1 or 2 line of the news but I want that he write more. how can I do this?

Johno69

Quote from: kandalf on August 13, 2008, 08:15:20 AM
Now the feedbot only write 1 or 2 line of the news but I want that he write more. how can I do this?

That could be relational to the feed you're trying to use.

comesee

I get this error, I am setting it up for a client.


Incorrect information in file: '.\smf_feedbot.frm'
File: J:\www\Sources\FeedPoster.php
Line: 56

vbgamer45

That is an error with a database table either the table does not exist or is corrupted.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

comesee

the table does not exist,  I have tried several times. What should Ido.

comesee

can i manuel create it.

ghostm

FOR TURKISH NON-UTF8 SITES

Install package from admin area and than open the file in package "Subs-RSS.PHP" or get it from "Sources" folder.

find this:
// Globals
$feedcount = 0;
$maxitemcount = 0;
$tag = '';
$insideitem = false;


after that copy and paste this:

# GLOBAL VARIABLES
$url = "http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-9.TXT";
//$url = "8859-9.txt";
$iso2utf = array();
$utf2iso = array();

# UNICODE MAPPING TABLE PARSING
function create_map($url){
    global $iso2utf, $utf2iso;
    $fl = @(file($url)) OR (die("cannot open file : $url\n"));
    for ($i=0; $i<count($fl); $i++){
        if($fl[$i][0] != '#' && trim($fl[$i])){
            list($iso, $uni, $s, $desc) = split("\t",$fl[$i]);
            $iso2utf[$iso] = $uni;
            $utf2iso[$uni] = $iso;
        }
    }
}

# FINDING UNICODE LETTER'S DECIMAL ASCII VALUE
function uniord($c){
    $ud = 0;
    if (ord($c{0})>=0 && ord($c{0})<=127)   $ud = $c{0};
    if (ord($c{0})>=192 && ord($c{0})<=223) $ud = (ord($c{0})-192)*64 + (ord($c{1})-128);
    if (ord($c{0})>=224 && ord($c{0})<=239) $ud = (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128);
    if (ord($c{0})>=240 && ord($c{0})<=247) $ud = (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128);
    if (ord($c{0})>=248 && ord($c{0})<=251) $ud = (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128);
    if (ord($c{0})>=252 && ord($c{0})<=253) $ud = (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128);
    if (ord($c{0})>=254 && ord($c{0})<=255) $ud = false; //error
    return $ud;
}

# PARSING UNICODE STRING
function utf2iso($source) {
    global $utf2iso;
    $pos = 0;
    $len = strlen ($source);
    $encodedString = '';
   
    while ($pos < $len) {
        $is_ascii = false;
        $asciiPos = ord (substr ($source, $pos, 1));
        if(($asciiPos >= 240) && ($asciiPos <= 255)) {
            // 4 chars representing one unicode character
            $thisLetter = substr ($source, $pos, 4);
            $thisLetterOrd = uniord($thisLetter);
            $pos += 4;
        }
        else if(($asciiPos >= 224) && ($asciiPos <= 239)) {
            // 3 chars representing one unicode character
            $thisLetter = substr ($source, $pos, 3);
            $thisLetterOrd = uniord($thisLetter);
            $pos += 3;
        }
        else if(($asciiPos >= 192) && ($asciiPos <= 223)) {
            // 2 chars representing one unicode character
            $thisLetter = substr ($source, $pos, 2);
            $thisLetterOrd = uniord($thisLetter);
            $pos += 2;
        }
        else{
            // 1 char (lower ascii)
            $thisLetter = substr ($source, $pos, 1);
            $thisLetterOrd = uniord($thisLetter);
            $pos += 1;
            $encodedString .= $thisLetterOrd;
            $is_ascii = true;
        }
        if(!$is_ascii){
            $hex = sprintf("%X", $thisLetterOrd);
            if(strlen($hex)<4) for($t=strlen($hex);$t<4;$t++)$hex = "0".$hex;
            $hex = "0x".$hex;
            $hex = $utf2iso[$hex];
            $hex = str_replace('0x','',$hex);
            $dec = hexdec($hex);
            $encodedString .= sprintf("%c", $dec);
        }
    }
    return $encodedString;
}

# CREATING ISO2UTF & UTF2ISO MAPS
create_map($url);


find this:
/*
if ($feed['html'])
{
$msg_body = '[html]' . $msg_body . '[/html]';
preparsecode($msg_body);
}
*/


before add:
$msg_body = utf2iso($msg_body);
$msg_title = utf2iso($msg_title);


let's upload this file. that's all. don't forget to run cronrss.php

i think you should get the the file "hxxp:www.unicode.org/Public/MAPPINGS/ISO8859/8859-9.TXT [nonactive]" to your root and remove the slash at Subs-RSS.php to get it from local.

Regards

Mr Selim

SwapsRulez

vbgamer45, Will it work in 2.0 Beta 3.1 if i parse it and then install it manually ?
Thanks. :)
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

fext

This mod refuses to work on my forum :(

My theme is DarkBreak and i have Curl enabled. It worked when i first installed it but never updated after that - tis was around a month ago.

I have just changed all the feeds and time duration between posting and also changed the poster - still nothing - any idea?

dakotaroar

Is there a way to disable checking for errors in the XML?  Or can someone point me to where in the code I need to go in order to do this?  One feed I am using has some horrible syntax sometimes, but it is unlikely they will ever fix it.
The only forum for students in North and South Dakota!  Campus Dakota.

trip001

#952
I have installed the MOD fine and i seem to have set it up fine too.

I have added a Cron in my cpanel (time values are set to *) destination is set to home/name/public_html/cronrss.php

I have fake cron turned off.
Feeds Enabled and set to 30mins

When i run the cronrss.php file using the URL it adds posts fine to the forum, however when i just leave the forums i am getting no updates at all so i'm gussing the cron doesn't appear to be running the php file..

Am i missing something obvious here??



edit: My host tells me that curl is enabled

comesee

i still get this error and can some give me a copy og the cron file

Incorrect information in file: '.\smf_feedbot.frm'
File: J:\www\Sources\FeedPoster.php..

trip001

#954
Quote from: trip001 on August 18, 2008, 07:47:20 PM
I have installed the MOD fine and i seem to have set it up fine too.

I have added a Cron in my cpanel (time values are set to *) destination is set to home/name/public_html/cronrss.php

I have fake cron turned off.
Feeds Enabled and set to 30mins

When i run the cronrss.php file using the URL it adds posts fine to the forum, however when i just leave the forums i am getting no updates at all so i'm gussing the cron doesn't appear to be running the php file..

Am i missing something obvious here??



edit: My host tells me that curl is enabled

Ok i finally got this working. Basically the path was incorrect and after a little search about on crontab in google i came across the answer.

My Host uses DirectAdmin Cpanel and basically the command path needs to be set to:

/usr/local/bin/php -q /home/name/domains/domain/public_html/cronrss.php

you can add  >/dev/null 2>&1 onto the end to save you receiving emails from every crontab action

hope this helps anyone that has the same issue

fext

Quote from: trip001 on August 19, 2008, 12:02:24 PM
Quote from: trip001 on August 18, 2008, 07:47:20 PM
I have installed the MOD fine and i seem to have set it up fine too.

I have added a Cron in my cpanel (time values are set to *) destination is set to home/name/public_html/cronrss.php

I have fake cron turned off.
Feeds Enabled and set to 30mins

When i run the cronrss.php file using the URL it adds posts fine to the forum, however when i just leave the forums i am getting no updates at all so i'm gussing the cron doesn't appear to be running the php file..

Am i missing something obvious here??



edit: My host tells me that curl is enabled

Ok i finally got this working. Basically the path was incorrect and after a little search about on crontab in google i came across the answer.

My Host uses DirectAdmin Cpanel and basically the command path needs to be set to:

/usr/local/bin/php -q /home/name/domains/domain/public_html/cronrss.php

you can add  >/dev/null 2>&1 onto the end to save you receiving emails from every crontab action

hope this helps anyone that has the same issue

Sounds like my issue is similar to yours BUT i have not set up any Crons jobs - is it easy to do and would this fix the issue?

trip001

Quote from: Youngie360G on August 19, 2008, 12:32:28 PM
Sounds like my issue is similar to yours BUT i have not set up any Crons jobs - is it easy to do and would this fix the issue?

As long as your host supports the functionality yes they are easy, just need to add the command. The crontab is normally under your hosts cpanel

comesee

i still get this error and can some give me a copy og the cron file

Incorrect information in file: '.\smf_feedbot.frm'
File: J:\www\Sources\FeedPoster.php..

any help

comesee


i do not have fake cron.. can someone please attach one for me to download.


here is my feedpostersql   please can you see any error in it.

<?php
// SMFHacks.com
// By: vbgamer45
// Table SQL

if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
  require_once(dirname(__FILE__) . '/SSI.php');
// Hmm... no SSI.php and no SMF?
elseif (!defined('SMF'))
  die('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.');


// Create Feeds Poster Table
db_query("CREATE TABLE IF NOT EXISTS {$db_prefix}feedbot
(ID_FEED mediumint(8) NOT NULL auto_increment,
ID_BOARD smallint(5) unsigned NOT NULL default '0',
feedurl tinytext NOT NULL,
title tinytext NOT NULL,
enabled tinyint(4) NOT NULL default '1',
html tinyint(4) NOT NULL default '1',
postername tinytext,
ID_MEMBER mediumint(8) unsigned,
locked tinyint(4) NOT NULL default '0',
markasread tinyint(4) NOT NULL default '0',
articlelink tinyint(4) NOT NULL default '0',
topicprefix tinytext,
numbertoimport smallint(5) NOT NULL default 1,
importevery smallint(5) NOT NULL default 180,
updatetime int(10) unsigned NOT NULL default '0',
PRIMARY KEY  (ID_FEED))", __FILE__, __LINE__);

// Feed Log

db_query("CREATE TABLE IF NOT EXISTS {$db_prefix}feedbot_log
(ID_FEEDITEM mediumint(8) NOT NULL  auto_increment,
ID_FEED mediumint(8) NOT NULL,
feedhash tinytext NOT NULL,
feedtime int(10) unsigned NOT NULL default '0',
PRIMARY KEY  (ID_FEEDITEM))", __FILE__, __LINE__);

// Fake cron setting default false
db_query("INSERT IGNORE INTO {$db_prefix}settings VALUES ('rss_fakecron', '0')", __FILE__, __LINE__);

// Feed try method
db_query("INSERT IGNORE INTO {$db_prefix}settings VALUES ('rss_feedmethod', 'All')", __FILE__, __LINE__);



$dbresult = db_query("SHOW COLUMNS FROM {$db_prefix}feedbot", __FILE__, __LINE__);
$removed =  1;
while ($row = mysql_fetch_row($dbresult))
{
   if($row[0] == 'markasread')
      $removed = 0;

}
mysql_free_result($dbresult);

if ($removed)
   db_query("ALTER TABLE {$db_prefix}feedbot ADD markasread tinyint(4) NOT NULL default '0'", __FILE__, __LINE__);

?>

fext

Quote from: trip001 on August 19, 2008, 12:49:25 PM
Quote from: Youngie360G on August 19, 2008, 12:32:28 PM
Sounds like my issue is similar to yours BUT i have not set up any Crons jobs - is it easy to do and would this fix the issue?

As long as your host supports the functionality yes they are easy, just need to add the command. The crontab is normally under your hosts cpanel

Wish i understood all this malarky - can you explain that URL to the cronsphp file? Were the bolded bits relevant to said persons server/domain?

Advertisement: