Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
XML feed wont run - server and coding all tested
Old 06-12-2010, 01:44 PM Re: XML feed wont run - server and coding all tested
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Ok

take the code from the function I posted, and paste it into rss.php after the opening php tag

PHP Code:
<?php
// Function to strip out all non asci characters
function strip_utf($string) {
  for (
$i 0$i strlen ($string); $i++)
    if (
ord($string[$i]) > 127)
      
$string[$i] = " ";
  return 
$string;
}


/*********************************************************************** 
  N-13 News is a free news publishing system 
  Copyright (C)  
   ***********************************************************************/
As above

then; locate
Quote:
$rsstemplate = str_replace("{comments}",$row['comments'],$rsstemplate);
echo $rsstemplate; this line
unset($categories);
in the same file and edit it to read

PHP Code:
echo strip_utf($rsstemplate); 
save and upload the modified file and test it.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
 
Register now for full access!
Old 06-13-2010, 03:15 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
Chris

Thank you for that. Didnt see we had rolled into page 2.


I added

Code:
  $rsstemplate = str_replace("{comments}",$row['comments'],$rsstemplate);
  echo strip_utf($rsstemplate);  
        unset($categories);

plus of course main code at rss.php page top. (note at edit)


But the RSS feed still wont load.


Meantime ive been looking in the wordpad download of the database for spurious hex code.

none found individually although the codes in the XML output (eg 3c, 2f, 1 c etc) can be found within things like session ids.

Last edited by alan_keys; 06-13-2010 at 03:34 AM..
alan_keys is offline
Reply With Quote
View Public Profile
 
Old 06-14-2010, 02:36 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
Chris

Ive got another opinion that those hex chunks are correct but not normally seen. Here is the comment.

They're a result of a chunked transfer encoding. Rather than send everything at once, PHP sends chunks of data as they are ready. It has to tell the browser how long each chunk is - that's the hex codes (the length of the chunk in hexadecimal). The browser keeps reading chunk length+chunk until it reaches the end with a chunk length of zero.
alan_keys is offline
Reply With Quote
View Public Profile
 
Old 06-14-2010, 08:14 AM Re: XML feed wont run - server and coding all tested
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Certainly that is true HOWEVER they should NOT be appearing in the datastream which is where the problem lies.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-17-2010, 05:09 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
Chris

A rewrite of the script has had an affect. We found that the script was making 'joins' for each article and that tables were being opened for each article invidually.

The resulting changes to script have improved the loading and also navigation of the site doesnt seem to be slowed down.


I still cant get the feed to validate though....


http://www.ukcitymedia.co.uk/news/rss.php?feed=New_News


is there any chance you could run your bugtool on it ???
alan_keys is offline
Reply With Quote
View Public Profile
 
Old 06-17-2010, 09:59 AM Re: XML feed wont run - server and coding all tested
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.cyberspyder.com/webbug.html is the tool I use, run it in HTTP version 1.1
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-18-2010, 05:56 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
Chris

Ran the tool. Still see the hex chunks but only after every second story which seems a bit strange.

If you believe that the chunks are causing the problem can you offer any more ideas for a solution....

I tried the ascii code stripper without success.
alan_keys is offline
Reply With Quote
View Public Profile
 
Old 06-19-2010, 02:26 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
Discounted the chuncked hex code issue

I created a new database of over a thousand articles. on http://homesplaces.co.uk/index1.php
This loaded witnin 2 seconds and the the RSS feed and feed passed validation.

I then loaded my problem database of about 430 articles. Takes sixteen seconds to load but FAILS VALIDATION. this time there is an error message.

http://homesplaces.co.uk/news/rss.php?feed=New_News
timed out : IO Error

Can you offer any more pointers based on this latest test ?


ps bothe feeds were checked in webbug. Both showed hex code chunks.
alan_keys is offline
Reply With Quote
View Public Profile
 
Old 06-19-2010, 04:31 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
i also have been able to get this error

•nonnumeric port: '' (InvalidURL; misconfigured server?)

plus

timed out : IO Error

can anyone direct me on this ??
alan_keys is offline
Reply With Quote
View Public Profile
 
Old 06-21-2010, 05:55 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
Chris

We found a bug in the code.
The fix is as follows.

Code:
rss.php, line 85+86 should be
$sql3 = "SELECT " . NEWS_CATS . ".name AS catname FROM " . NEWS_GROUPCATS . " INNER JOIN " . NEWS_CATS . " ON " . NEWS_GROUPCATS . ".catid = " . NEWS_CATS . ".id WHERE storyid = ? AND type = 'news' ORDER BY " . NEWS_CATS . ".name ASC";
$cats = DataAccess::fetch($sql3, $row['id']);
Trouble is that now the feed wont validate. Can you help at all with some ideas or tests
It would be very much appreciated.
alan_keys is offline
Reply With Quote
View Public Profile
 
Old 06-21-2010, 12:20 PM Re: XML feed wont run - server and coding all tested
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
What are you meaning by "validate"?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-22-2010, 01:43 AM Re: XML feed wont run - server and coding all tested
Average Talker

Posts: 18
Name: alan keys
Trades: 0
Well priciply i mean
http://feedvalidator.org/
and
http://validator.w3.org/feed/


Crucially, I cant set up a twitterfeed because the feed fails validation. So, the feed fails at
http://twitterfeed.com/


I also did some testing at feedburner and got the folllowing failure message


************

Your feed filesize is larger than 512K. You need to reduce its size in order for FeedBurner to process it. Tips for controlling feed file size with Blogger can be found in Tech Tips on FeedBurner Forums, our support site.

http://feedburner.google.com/fb/a/addfeed


The feed itself

database is mySQL
is around 1 Mb as a wordpad sql file.

and the database has
450 stories
each about 250 - 300 words in length.



I did some testing on an empty database and got the following results. [but since this test, the script writer altered the code as indicated two posts ago, feed then load MUCH QUICKER} but still fails validation].


I decided to post up to one hundred posts of around 140 to 180 words. Each post had an average length title and a category selected. I then timed the loading of rss feed getting the following result.

45 1.50
61 2.40
67 3.10
72 3.50
79 4.60
87 5.80
93 7.10
100 8.60

At one hundred posts the feed still validates.


At 400 posts of 300 word length, the system timesout and fails validation.
alan_keys is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to XML feed wont run - server and coding all tested

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.58253 seconds with 11 queries