View unanswered posts | View active topics

Reply to topic  [ 4 posts ] 

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post Metadata - export to Access: Comment ..
Well I can study xml in detail and than I can do phd from Python and finally I can do my own RSS reader. I bought Awasu bacouse of its hook fuctionality and becaouse I expected that main futures are supported by exact samples. I do hope you will provide two lines of code that are needed here in order to close this subject as quick as possible. I know a few xml basic. I do not know what exactly is needed. In case you know solution why I need to spend entire day studing xml, learning by mistakes and consequently posting new questions on here..


Sat Aug 30, 2008 11:41 am
Profile WWW

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post Solution ..
Tag:
ItemMetadata=<value>CORRECTION FROM SOURCE: PlayBOX in Negotiations to Acquire New Visions Mobile</value><group><value>http://www.marketwire.com/mw/release.do?id=882770&sourceType=3</value></group><group><value>OTC Bulletin Board:PYBX</value><value>http://www.marketwire.com/rss/stock</value></group><value>1216986300</value>

Goal:
Extracting tag name='ID'

Code - this seems to work ..
# get our channel values
MetaData = win32api.GetProfileVal( "NewFeedItem" , "ItemMetadata" , "" , configFilename )
MetaData = str(MetaData)
D = MetaData.find('ID')
if D>-1:
start = MetaData.find('ID')
start = (start)+4
end = MetaData.find('</value><value')
MarketInfo = MetaData[(start):(end)]
D2 = MarketInfo.find(':')
if D2>-1:
split = MarketInfo.split(':')
StockMarket,Ticker = split
xTicker = (Ticker)
else:
xTicker = "No Ticker"
else:
xTicker = "No ID Tag"

Xpath solution would be very welcome as it is probably more stabile..


Sat Aug 30, 2008 2:59 pm
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2896
Location: Melbourne, Australia
Post Re: Metadata - export to Access: Comment ..
Otonicara wrote:
I do not know what exactly is needed.

Neither do I.

I don't know much about XPath (other than it's probably the best way to do what you're looking to do), so to answer your question, I would need to do a lot of investigation, go through the tutorials I linked to previously, etc.

Yes, it's a bit of work, especially if you don't know much about XML, but these forums are for <u>Awasu-specific</u> issues e.g. how does Awasu communicate with plugins, such-and-such a feature in Awasu doesn't seem to work properly, I would like to request a new feature in Awasu, etc. How to parse XML in Python is a Python/XML issue and there are other websites/newsgroups devoted to these topics. We've had people coming here looking for help on removing viruses from their computer or downloading software from other sites. These are clearly outside the scope of these forums, as is the question of how to parse XML in Python.

Otonicara wrote:
I expected that main futures are supported by exact samples.

We cannot possibly provide samples that cover every possible situation that every possible customer could ever possibly want so we provide samples that demonstrate broad guidelines on how to write plugins, etc. Unfortunately, it's the nature of the beast that if you want to write programs to do do stuff, you need to be able to program and if you want to write programs that deal with XML, you need to know how XML works.


Sat Aug 30, 2008 3:15 pm
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2896
Location: Melbourne, Australia
Post Re: Solution ..
Otonicara wrote:
Code - this seems to work ..

Yes, it probably will. Parsing XML using string functions is notoriously unreliable but it will probably be OK. XPath is doing things "the right way" but if this works, then it's probably good enough :-)


Sat Aug 30, 2008 3:18 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online
Users browsing this forum: Google [Bot] and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: