Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2009, 01:44 AM
mbtalk mbtalk is offline
 
Join Date: Sep 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default RSS feed as "info box"

Please pardon me if this has been answered elsewhere. I have searched extensively, but being new to vbulletin I fear my query words may not have hit their mark.

I am looking for something to take an RSS feed and place only the latest result set in a single location, overwriting any previous data. A perfect example of this behavior are the weather plug-ins. In my case, the RSS feed are the present ocean conditions at a given NOAA buoy (http://www.ndbc.noaa.gov/data/latest_obs/42039.rss)

For reference, the problems I have experienced are:
Stock RSS feed - Creates multiple threads or announcements.
RSS as post - Creates one thread with lots of outdated, useless, data.

Placing the feed in the announcements would work, *if* it each new update deleted the previous announcements.

Any sugestions?

Philip
http://www.MexicoBeachTalk.com

P.S. Unrelated thoughts/comments/criticisms on the site are welcome.
Reply With Quote
  #2  
Old 09-15-2009, 11:00 AM
mbtalk mbtalk is offline
 
Join Date: Sep 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump.
Reply With Quote
  #3  
Old 09-15-2009, 02:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds interesting, but I must say I've never seen anything like this discussed before. I'm not sure exactly how I would go about it.
Reply With Quote
  #4  
Old 09-15-2009, 02:49 PM
mbtalk mbtalk is offline
 
Join Date: Sep 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I may not be describing it properly.

At the top of my site (and others), there is a box that displays the present weather (screenshot attached). The mod simply uses a vbCron job to pull an RSS feed from weather.com and stuffs it into a text file. When the user loads the page, the text file is read, reformated, and inserted into the DIV you see there. To locate the weather info, I just place the variable $weather into my template wherever I want the weather box to appear.

What I am looking for is *exactly* like that, only it reads from a different RSS source and stuffs it into a different variable.

What I'm getting is post after post (rss in post mod) where only the latest data is of any value. If there was a way to make that mod (or vB) delete the outdated posts, it would work fine as a post/thread/accnouncement.

I have considered hacking the weather script to make it work, but I don't have any experience with vB add on and how they integrate.
Attached Images
File Type: jpg weather.jpg (78.2 KB, 0 views)
Reply With Quote
  #5  
Old 09-15-2009, 03:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I understand what you want. But, I think you will have to write a custom script to do this. Actually, an easy way may be to post the rss feed to a hidden forum and then post the post content on your page where you want it (query for the latest post in that forum). Make sure when you pull the post, you don't worry about permissions since it is in a hidden forum.
Reply With Quote
  #6  
Old 09-15-2009, 03:17 PM
mbtalk mbtalk is offline
 
Join Date: Sep 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That might work, but I'm not too keen on filling the DB with posts and having to manually clear it every so often.

I think I'll just try and hack the weather mod to permit two instances running. That's exactly what I need as this is sea conditions info vs. air conditions.

I can't believe there isn't a mod like this for any generic RSS feed. It would be useful in a number of transient data applications such as a stock ticker, joke of the day, or any type of distributed announcement.

--------------- Added [DATE]1253036733[/DATE] at [TIME]1253036733[/TIME] ---------------

Success! Here's what I did;

I took the add-on's php & xml files and and replaced every instance of "weather" with "seacond", checking to see if it made sense in context. I also replaced weather in all the filenames with seacond. Installed 'seacond' as per the instructions, and configured my new vbulletin option (and crontab) named "Seacond". Tested by replacing $weather in the navbar with $seacond, and it worked as expected.

Since I couldn't find an unobtrusive place for the block of data, and it generally only applies to fishermen, I modified the navbar template to replace "weather" with "Seacond" in the fishing forum only. Navbar mod follows:

PHP Code:
<!-- / ADDED FOR SEACOND AND WEATHER -->

<if 
condition="$foruminfo[forumid] == 3">
   <
td class="alt1" width="45%">$seacond</td>
<else />
   <
td class="alt1" width="45%">$weather</td>
</if> 
Anyone see any gotcha's to this approach?
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 05:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04627 seconds
  • Memory Usage 2,237KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete