Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Error while using gFeedFetcher.js

  1. #1
    Join Date
    Apr 2014
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Error while using gFeedFetcher.js

    1) Script Title: gFeedFetcher.js / gajaxticker.js

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...xrssticker.htm

    3) Describe problem:

    Hi I'm having an issue while using the gAjax RSS Ticker (hosted) which uses the following two scripts: gFeedFetcher.js & gajaxticker.js.

    Most of the time it works fine and the RSS feed is displayed, but sometimes I get a range of error messages displayed in place of the feed:

    1. ERROR: Timed out waiting for data to be extracted. If the problem persists, try simplifying your search patterns.

    2. MAXIMUM ERROR COUNT REACHED

    3. SSL: Socket Timeout

    Can you please help in finding out why these are being displayed?

    I am including both scripts in the head of the page and have the following in the body:
    Code:
    <script type="text/javascript">
          var newsfeed = new gfeedrssticker( "mni3", "class3", 10000, "_new" )
          newsfeed.addFeed( "MNI", "http://feed43.com/mniusdsmall.xml" ) //Specify "label" plus URL to RSS feed
          newsfeed.displayoptions( "snippet" ) //show the specified additional fields
          newsfeed.setentrycontainer( "li" ) //Display each entry as a paragraph
          newsfeed.filterfeed( 5, "date" ) //Show 5 entries, sort by date
          newsfeed.entries_per_page( 1 )
          newsfeed.init() //Always call this last
        </script>
    When I check the RSS feed by entering the URL in a web browser it displays fine...

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It's working for me. You say you've included both scripts. There are actually three:

    Code:
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    
    <script type="text/javascript" src="gfeedfetcher.js"></script>
    
    <script type="text/javascript" src="gajaxticker.js">
    
    /***********************************************
    * gAjax RSS Ticker- (c) Dynamic Drive (www.dynamicdrive.com)
    * Requires "gfeedfetcher.js" class
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    The first is remote hosted by Google. The other two should be in the same folder as your page.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2014
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi John, I have included the google script (<script type="text/javascript" src="http://www.google.com/jsapi"></script>), and the feed does display 9 out of 10 times - its just very hard to predict when the error will be displayed without watching the ticker all the time.. sometimes the error will popup for 5 minutes and then go away again.

    I have been looking at a workaround by using the Search and replace functionality in gfeedfetcher.js to search for when the error displays and replace it with a more user friendly message. This works fine when using a static ticker and adding in the instance.addregexp rule (e.g. http://www.dynamicdrive.com/dynamici...sdisplayer.htm)

    However when attempting to get the search and replace functionality to work when using a moving scroller - gajaxticker.js (http://www.dynamicdrive.com/dynamici...xrssticker.htm) it does not seem to work.

    The below is my code, where I am attempting to replace the word 'Analysis' in the title field with the word 'Loading...'
    Code:
     <script type="text/javascript">
          var newsfeed = new gfeedrssticker( "mni1", "class1", 10000, "_self" )
          newsfeed.addFeed( "MNI", "http://feed43.com/mnieursmall.xml" ) //Specify "label" plus URL to RSS feed
          newsfeed.displayoptions( "snippet" ) //show the specified additional fields
          newsfeed.setentrycontainer( "li" ) //Display each entry as a paragraph
          newsfeed.filterfeed( 5, "date" ) //Show 8 entries, sort by date
          newsfeed.entries_per_page( 1 )
          newsfeed.addregexp(/(Analysis)\b/ig, 'Loading...', 'titlefield')
          newsfeed.init() //Always call this last
      </script>
    Does gajaxticker.js need to be modified in some way so that it picks up the instance.addregexp rule?

    Thanks

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, I was trying this again for you and got the error on the uero feed. I then tried contacting the feed directly and got:

    "Server is experiencing heavy load. Please try again in a few minutes"

    or something very close to that. It's what the server sends out when it cannot send the feed. The message you are getting though is from Google, it's server's response to the above response from the feed server. This is made worse because Google caches responses so will show the feed as down for longer than it actually is.

    I would suggest, if you have PHP on your server, using an alternative script like:

    http://www.dynamicdrive.com/dynamici...ller/index.htm

    for which there's an unofficial update (works better on more modern feeds/servers):

    rsspausescroller_pie.zip

    I suggest this because although it would have a similar problem because it caches the feeds as well, they are cached on your server and you control for how long. But it requires that your host have PHP available to you to process the feed.

    As to your other question, yes. The gajaxticker.js script would have to be changed as the code in the fetcher script that uses the regEx's isn't used by the ticker script. So, if you want to remain with these scripts and get a custom error message (as I think you've guessed, it's the title field), use this version which implements the regEx's (right click and 'Save As'):

    gajaxticker.js
    Last edited by jscheuer1; 04-16-2014 at 01:59 AM. Reason: add gajaxticker.js
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2014
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you for investigating the cause of the error, I don't have PHP enabled on my web server at the moment but will look to get it setup.

    The script which you modified is working great, however when I have tested using the new gajaxticker.js (and also infact gFeedFetcher.js for static feeds) using the search and replace functionality, it is working to modify strings in the title of real news items - but when it comes to the error messages which are displayed, the regEx rule seems to be ignored even though the error message is displayed in the title field.

    Do you know why this would be?

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    No. In fact I tried it with the updated gajaxticker.js script and the:

    ERROR: Timed out waiting for data to be extracted. If the problem persists, try simplifying your search patterns.
    error using:

    Code:
          newsfeed.addregexp(/(Error)\b/ig, 'Loading...', 'titlefield')
    Which made it:

    Loading... Timed out waiting for data to be extracted. If the problem persists, try simplifying your search patterns.
    So it did work for that. What regEx(s) did you use? I did not try it without the updated gajaxticker.js script, so I cannot verify that it would work with only gfeedfetcher.js.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Apr 2014
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Really, that's great to hear it worked!

    I was testing only the static ticker with gfeedfetcher.js, using the following regEX:

    newsfeed.addregexp(/(ERROR: Timed out waiting for data to be extracted. If the problem persists, try simplifying your search patterns.)\b/ig, 'Loading...', 'titlefield')

    I will try out the above rule with the new gajaxticker.js, but if it worked for you i'm sure it will be fine to replace the whole error string for a moving ticker.

    Do you think that the logic in the search and replace in gfeedfetcher.js is different?

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm pretty sure it is. I looked at it as a sort of guide as to how to implement it in the gajaxticker script. I didn't like the code, so I changed it. And where it is used in the fetcher script is in a function that's not used in the ticker script. So I had to implement it in a function of the ticker script. But that's no guarantee that the logic is different. In fact it can't really be all that different, or it wouldn't work. It's just a question of when and under what circumstances it's employed. If you're still having a problem, it's probably that the RegEx you're using doesn't match the text you want to change. If you're still having problems though, let me know. I will try testing your exact RegEx.

    Looking at your RegEx I would get rid of the \b part. It's redundant at best. At worst, since it follows a period and precedes the end of the string, it cannot technically be a word border. In that case it wouldn't match. It doesn't, I just tested it. Get rid of the \b in it. Then it should work. Does in testing here with the string. I will have to wait for the actual error to be certain.
    Last edited by jscheuer1; 04-17-2014 at 03:36 PM. Reason: looked closely at the RegEx - later - typo
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Ro. (04-18-2014)

  10. #9
    Join Date
    Apr 2014
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I've removed the \b now and will wait for the error message to appear to see if it replaces it...

    Thanks again for your help its very much appreciated

  11. #10
    Join Date
    Apr 2014
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    ok I've tested and the regex search and replace is working on both scripts gfeedfetcher.js and gajaxticker.js for replacing the error messages in the title field

Similar Threads

  1. gfeedfetcher substring, need help
    By hofleverancier in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 08-18-2013, 10:09 AM
  2. I need gfeedfetcher help
    By pappa74 in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 02-06-2013, 08:49 PM
  3. gfeedfetcher issue
    By gendos in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 07-17-2012, 03:53 PM
  4. gfeedfetcher problem
    By takethecake in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 05-19-2012, 02:35 AM
  5. gfeedfetcher description
    By danskkr in forum Dynamic Drive scripts help
    Replies: 7
    Last Post: 05-16-2011, 08:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •