PDA

View Full Version : Anyone working on a RSS plugin



2004-08-17, 06:24 PM
Has anyone developed or started development on a RSS plugin for gbpvr.

sub
2004-08-17, 06:31 PM
I dont think I've heard it mentioned from anyone in the past. Are you thinking about giving it a go?

colin
2004-08-17, 07:07 PM
That sounds like it could be a fun to have plugin,

Colin.

CodeMonkey
2004-08-17, 07:34 PM
The newsfeed thing? That would make a nice addition.

2004-08-17, 08:30 PM
I have not had a chance to play with .net at all doing mostly java development. The RSS format looks very easy. It seems like it would be a useful plugin.

2004-08-17, 10:23 PM
Well. I have downloaded the comic plugin and started modifying it for rss news. I am sure it is pretty buggy, but at least the basic logic is there. I also need to clean it up changing the names of the variables from the comic stuff to something more relevant. I also have only tested it with 3 feed sites. Techbargains, slashdot, and pc world. So far so good.

Any either big sites that I should test with.


Also I have not figured out how to get rid of the daily comics title at the top.

colin
2004-08-18, 12:05 AM
Hi Jorm,

I have not had a detailed look at the Comic Plugin code but Its probably in the skin.xml file.

As for sites with RSS, there is freshmeat.net, sourceforge.net and I'm sure others will send on more. The RSS stuff is pretty straight forward. I did some stuff in php before to generate and parse RSS feeds. What versions are you going to support?

Cheers,
Colin.

sub
2004-08-18, 12:44 AM
Colin is right, the title is in the skin.xml.

Change the getSkinSubdirectory() method to return "RSS", then copy the existing C:\Program Files\devnz\gbpvr\skin\Blue\comics directory to C:\Program Files\devnz\gbpvr\skin\Blue\RSS. Then edit the skin.xml as appropriate.

Slashdot would be a good RSS to include.

2004-08-18, 03:17 AM
RSS feeds from OSNews.com and Blabbermouth.net would be great also!

tkgafs
2004-08-18, 10:52 AM
The BBC would be a good feed to use

2004-08-18, 01:53 PM
Well I added a bunch of sites. The following sites are currently hardcoded and seem to be working.

SlashDot
PC World
TechBargains
CNN
BBC
NY Times
SourceForge
Washington Post
Freshmeat

I did learn the hard way that if you hit slashdot more than once in 30 minutes you get banned. Not a wise site to test with. I have the code and the plugin. Does anyone have a location that I can post it too. Please send me an email address that I will send the stuff too.

I have done some basic testing but I am sure I will have other volunteers. http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

Sub, I had a question with the skin. I modified the skin and that worked. But how is that deployed. Do I just add the skin files to the post and each users downloads it and drops it in.

Also is there any way to get the current directory for the gbpvr such that I can remove the hardcoded sites and push it out to an xml config file.

colin
2004-08-18, 03:40 PM
Quote[/b] ]I did learn the hard way that if you hit slashdot more than once in 30 minutes you get banned. Not a wise site to test with. I have the code and the plugin. Does anyone have a location that I can post it too. Please send me an email address that I will send the stuff too.

probably best to send it to support@devnz.com


Quote[/b] ]
I have done some basic testing but I am sure I will have other volunteers.

volunteers will not be a problem http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif


Quote[/b] ]
Sub, I had a question with the skin. I modified the skin and that worked. But how is that deployed. Do I just add the skin files to the post and each users downloads it and drops it in.


most of us include the skin/<>/RSS/* in the zip file with the dll.


Quote[/b] ]
Also is there any way to get the current directory for the gbpvr such that I can remove the hardcoded sites and push it out to an xml config file.

Take a look at the weather plugin and see how it does the configuration stuff. This will allow you to store the information in the config.xml file. Also it will show you how to retrieve the data back again.

Cheers,
Colin.

CodeMonkey
2004-08-18, 03:43 PM
For an example of how to make it configurable, look at how the weather plugin handles its configuration dialog.

I was going to do the same to the comic plugin, but now I can't install VS .NET because of a bad CD. If it isn't one thing, it's another.

2004-08-18, 05:14 PM
Well I looked at the Weather plugin. Did not look too bad. However I am getting errors which my limited knowledge of C# I cant figure out how to debug or see the full stack trace.

This is actually a different plugin. This is for an address book viewer. Just the one I am playing with now. Right now it looks for the address book xml in the C: I want to give the user an ability to specify it somewhere else.


When I click on settings I get the following stack trace. Any thoughts or leads?

System.NullReferenceException: Object reference not set to an instance of an object.
at AddressBookPlugin.AddressBookConfigForm.DiskSpaceC onfigForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()


If I click continue and then ok I get this one

System.NullReferenceException: Object reference not set to an instance of an object.
at AddressBookPlugin.AddressBookConfigForm.buttonOK_C lick(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)


Obviously something is null. However I have a catch all in the load just to see if that would catch it. I do not see the line that the error actually occured on just the method.

private void DiskSpaceConfigForm_Load(object sender, System.EventArgs e)
{
areaCode = "c:/addressbookdb.xml";
if ( settings != null )
{
try
{
XmlNode node = settings.SelectSingleNode("/settings/AddressBookPlugin/filename");

if (node != null)
{
// ... override with user's supplied setting
areaCode = node.InnerText;
}
}
catch
{
}
}
textBoxFilename.Text = areaCode;
}

private void buttonOK_Click(object sender, System.EventArgs e)
{
// First check that section exists in XML setting file
XmlNode node = settings.SelectSingleNode("/settings/AddressBookPlugin/filename");
if (node == null)
{
// ...if it doesnt, then create the correct nodes (with dummy values)
string newNodeXML = "<settings>\n" +
" <AddressBookPlugin>\n" +
" <filename>c:/addressbookdb.xml</filename>" +
" </AddressBookPlugin>\n" +
"</settings>\n";

XmlDocument newDocument = new XmlDocument();
newDocument.LoadXml(newNodeXML);

XmlNode imported = settings.ImportNode(newDocument.DocumentElement.La stChild, true);
settings.DocumentElement.AppendChild(imported);

node = settings.SelectSingleNode("/settings/AddressBookPlugin/filename");
}

// save area code value in settings xml
node.InnerText = textBoxFilename.Text;

// .... file will be saved later by the config app, if the user presses the OK button
}


You can use the same code for the plugin for any collection.
Just specify the xml.

<database>
<category name="Family">
<item name="Bill Gates" value="Home : 555-5555#Address : Washington #Office : 444-4444"/>
<item name="Ted Turner" value="This is a test#here"/>
</category>
<category name="Friends">
<item name="Sub" value="555-5555"/>
<item name="Mr T" value="This is a test#here"/>
</category>
</database>

It is layed out the same as comics. The categories are in the top left box. Selecting one of those shows the items in that category in the right box. double clicking on that shows the multi line value in the bottom box.

The # are used to designate new lines.