realbasic-nug
[Top] [All Lists]

Re: RSS feeds

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: RSS feeds
From: Erik Scholtz <anomar at elitecoderz dot net>
Date: Mon, 30 May 2005 23:35:42 +0200
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20050530133107 dot 259459EF41C at lists dot realsoftware dot com> <429B484F dot 50009 at comcast dot net> <E68566D1-3111-441D-B42D-5C196B0D52ED at mac dot com>
Stefan Pantke wrote:

Am 30.05.2005 um 19:07 schrieb Craftkiller:

wow now I feel ...


And if you'd lik to start using XQL, you'd like to use something like
this. Note, this example is for RSS 2.0:

 >>>
Function ParseRSS20( rssRoot As XMLNode )
...


Stefan

Hi Stefan,

I thought about using a XML-Parser, but I'm not sure if this will work for Craftkiller, since he does not want to remove all tags (if I understood him right).

> Craftkiller wrote:
I know for other things for like file open dialogs u cud have it search for 
stuff that has *.gif will this work for something like this:
content=replaceall(content, "<a href" + * + "</a>","")

No, this won't work. Replace with patterns will only work with RegularExpressions. * has a completely different meaning in RegExp and is not the placeholder for any characters. In fact, * stands for "No or multiple occurrence of the character directly before the *" and is a so called "Mask-charcter".

--


I'm not sure what you want to delete (by the way - forget about what I wrote with CLF/LF - this is an RB option, that the replace stops on first match by default):

  dim re as new regEx

re.SearchPattern = "(<link>|</link>|<title>|</title>|<a href=.+?>|</a>)|<.+?>"
  re.ReplacementPattern = "$1"
  re.Options.ReplaceAllMatches = true
  EditField1.text = re.replace(EditField1.text)


This regexp will do the following to the content of EditField1 (in my example the RSS-feed of RB with an additional link):

///////////////////
Example-Text:
-------------
<rdf:RDF>
-
<a href="http://little.edit.for.demo/";>Demo Link to demo RegExp</a>
<channel rdf:about="http://www.realsoftware.com/rss/realsoftware.xml";>
<title>REAL Software News</title>
<link>http://www.realsoftware.com</link>
<description>News and Events for REALbasic Users</description>
<image rdf:resource="http://www.realsoftware.com/images/rssGraphic.gif"/>
<language>en-us</language>

///////////////////
Result:
-------

-
<a href="http://little.edit.for.demo/";>Demo Link to demo RegExp</a>

<title>REAL Software News</title>
<link>http://www.realsoftware.com</link>
News and Events for REALbasic Users

en-us


///////////////////


All tags in the ( ) seperated each by a pipe (|) will be "ignored" (replaced by themself). "re.Options.ReplaceAllMatches = true" makes the RegExp walk through all matches.

I hope this is what you need. If not, please send two examples of your code you want to be replaced. One "before replacing", the other after replacing. I'll then make you a RegExp asap.



Best regards,
Erik
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>