vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   RSS feed as "info box" (https://vborg.vbsupport.ru/showthread.php?t=223133)

mbtalk 09-14-2009 01:44 AM

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.

mbtalk 09-15-2009 11:00 AM

bump.

Lynne 09-15-2009 02:05 PM

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.

mbtalk 09-15-2009 02:49 PM

1 Attachment(s)
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.

Lynne 09-15-2009 03:02 PM

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.

mbtalk 09-15-2009 03:17 PM

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?


All times are GMT. The time now is 06:12 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01161 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete