FeedForDevX 0.9 Documentation (FeedForDevX ActiveX control)

Installation: (beta release)

1. Unzip contents of the FeedForDev.zip file to a temporary folder.  Browse to that folder on your system.  Copy the contents of the 'ActiveX' folder to a location on your drive where you want to keep the FeedForDevX component (somewhere under 'program files' is the most common location to put it (you may want to give it its own folder).

2. You will need to manually register FeedForDevX as a component with Windows, because it doesn't have an installer yet. You will need to run the Windows regsvr32.exe program to do this.  The syntax is:

<system-path>\regsvr32 <component-path>\feedfordevx.ocx

Where <system-path> is the path to your Windows system folder (i.e. c:\windows\system32, or c:\winnt\system32)

Where <component-path> is the path to the folder where you extracted the feedfordevx.ocx control

Here is a full example:

c:\windows\system32\regsvr32 c:\program files\feedfordev\feedfordevx.ocx

3. You should get a message that the component was successfully registered.

4. You will now be able to add the FeedFordevX component to your control pallet in your development environment


Reference:

Component: TffdRSSReader

Published Properties:

Address - Full path and filename to a local RSS Feed, or full URL (including http://) to a RSS feed on the Internet.

Blocking - When set to True, the GetFeed prodedure call won't return until the feed has been read in (or generates an error).  When set to False, the GetFeed procedure call will return immediately, and then fire the OnFinished event when the feed has been read in (or generates an error).

CategoryFilter - Sets a category filter.  Only feed items that have a matching category entry will show up. You must call GetItems after changing this to re-filter the items.

PubDateStart - When the PubDateFilter property is set to True, feed items with a PubDate older than this will not show up in the current Items.

PubDateEnd - When the PubDateFilter property is set to True, feed items with a PubDate newer than this will not show up in the current Items.

PubDateFilter - When set to True, the PubDateStart and PubDateEnd values will be used to filter what feed items will show up in the current Items.

PubDateSort - Will determine what order feed items will show up in the current Items.  Possible values are: pdsNone, pdsAscending, and pdsDescending. 

LicenseKey - When you purchase a license for FeedForDev you will receive this information.  You will then need to enter it into this field.

LicenseName - When you purchase a license for FeedForDev you will receive this information.  You will then need to enter it into this field.

LicenseSN - When you purchase a license for FeedForDev you will receive this information.  You will then need to enter it into this field.

Registered - If valid license information has not yet been entered, this field will stay False.  It will automatically switch to True after valid license information has been entered.  When FeedForDev is not registered it will intermittently return a notice to that effect as an item's title or description.

Public Properties:

ErrorCode - error while loading RSS Feeds:
	ecNone
	ecFileNotFound
	ecCantDownload
	ecInvalidXML
	ecInvalidRSS

ErrorDescription - A Text version of error while loading RSS Feeds.

FeedTitle - The title of the RSS feed

FeedDescription - The description of the RSS feed

FeedLink - The given in the RSS feed

ItemCount - The number of current Items retrieved from the last GetItems call. The CategoryFilter and PubDateFilter properties can effect which items are available.

ItemNumber - The index number of the current item (first item = 1)

ItemCategory - The category of the current item

ItemTitle - The Title of the current item

ItemDescription - The Description of the current item

ItemLink - The Link of the current item

ItemPubDate - The PubDate of the current item

ItemEnclosureUrl - The url of the current item's enclosure

ItemEnclosureLength - The length of the current item's enclosure

ItemEnclosureType - The mime type of the current item's enclosure

RawFeed - The raw text of the feed. 

Procedures:

Clear - Clears out any loaded feed and its items.  All filters will also be reset to their defaults.

GetFeed - Tries to read in the RSS feed specified by the Address property.  If the address is a URL, then the feed will be downloaded from the Internet.  If the address is a local file path, then the local file will be read in. When GetFeed is called, it will either return immediately, or wait until the feed is downloaded, depending on what the Blocking property is set to.  If GetFeed is successful, the ErrorCode property return ecNone, and the ErrorDescription will be ''.  If GetFeed is successful all the filters (i.e. CategoryFilter, PubDateFilter, and PubDateSort) will be reset back to their defaults and GetItems will be automatically called, so that initially all feed items are available.

GetFeedFromString - Same as GetFeed, but the feed is supplied in as string (or widestring).  This can be used if the program already has a copy of the feed in memory, and FeedForDev doesn't need to download or load the feed file.

GetItems - After making changes to the filters (i.e. CategoryFilter, PubDateFilter, and PubDateSort) call GetItems to return just the matching items.


Basic Usage:

1. Set Address and Blocking properties
2. Call GetFeed
3. Check ErrorCode
4. Set CategoryFilter, PubDateFilter, PubDateStart, and PubDateEnd if desired
5. Call GetItems if filters have been changed, otherwise this isn't necessary
6. Check ItemCount for number of matches
7. Set ItemNumber for the desired item
8. Read desired Item properties (i.e. ItemTitle, ItemDescription, ItemLink, etc.)


Here is an example in Visual Basic, that shows all of a feed's items that belong to the 'Tips' category (only the title for each item is displayed):

Start a new project and put a ffdRssReader, a button and a Text control on the form.  Set the text control's 'multiline' property to True, and then modify the OnClick event for the button as follows:

Private Sub Command1_Click()
  ffdRssReader1.Address = "http://www.feedfordev.com/sample-feed.xml"
  ffdRssReader1.GetFeed
  If ffdRssReader1.ErrorCode = ecNone Then
    ffdRssReader1.CategoryFilter = "Tip"
    ffdRssReader1.GetItems
    ffdRssReader1.ItemNumber = 1
    If ffdRssReader1.ItemCount > 0 Then
      Do While ffdRssReader1.ItemNumber <= ffdRssReader1.ItemCount
        Text1.Text = Text1.Text + ffdRssReader1.ItemTitle + vbCrLf
        ffdRssReader1.ItemNumber = ffdRssReader1.ItemNumber + 1
      Loop
    Else
      MsgBox ("No items in the feed had ""Tip"" for the category")
    End If
  Else
    MsgBox (ffdRssReader1.ErrorDescription)
  End If
End Sub


A more robust demo project is included in the download file, in a folder named 'Demo'. There is also a simple VBScript sample there, in MS Excel.


Thanks for trying FeedForDevX

The FeedForDev Team
www.feedfordev.com
support@feedfordev.com
www.feedfordev.com/forum
