Page 1 of 1

Metadata - export to Access

Posted: Sun Aug 17, 2008 3:41 pm
by Otonicara
1.) Which tag should be used in code bellow to capture Category Metadata in Access Export?

xTicker = win32api.GetProfileVal( "NewFeedItem" , "ItemMetadata/Category" , "" , configFilename )

2.) Which tag should be used in code bellow too capture Description. This is standard field however I do not find the filed in logfile.

xDescription = win32api.GetProfileVal( "NewFeedItem" , "ItemDescription" , "" , configFilename )

HOOK INSPECTION: Log File
[NewFeedItem]
ItemTitle=CORRECTION FROM SOURCE: PlayBOX in Negotiations to Acquire New Visions Mobile%0A*0
ItemUrl=http://www.marketwire.com/mw/release.do?id=882770&sourceType=3
TimeCreated=1216986640
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>
ItemContent1_Content=LONDON, UNITED KINGDOM--(Marketwire - July 25, 2008)


ORIGINAL SOURCE INSPECTION:
<item>
<title>Telenor to appeal Siberian verdict in collusive lawsuit instigated by Alfa</title>
<link>http://www.marketwire.com/mw/release.do?id=890322&amp;sourceType=3</link>
<description>&lt;p&gt;OSLO, NORWAY--(Marketwire - August 16, 2008) - (Fornebu, Norway - August 16, 2008) A court in
the Siberian city of
Khanty-Mansiysk, Russia shortly after 2 am Saturday morning local
time issued a verdict holding Telenor liable for USD 2,824,125,677 in
damages plus RUR 460,000 in costs for allegedly having delayed
VimpelCom's acquisition of Ukrainian Radio Systems, a small Ukrainian
mobile operator. Telenor strongly believes the claimant Farimex is
affiliated with the Alfa Group and that the case has no merit.
Telenor is confident it will prevail in reversing the decision on
appeal.
</description>
<category>nasdaq:TELN</category>
<pubDate>Sat, 16 Aug 2008 03:38:00 EDT</pubDate>
</item>

Re: Metadata - export to Access

Posted: Sun Aug 17, 2008 5:25 pm
by support
Otonicara wrote:1.) Which tag should be used in code bellow to capture Category Metadata in Access Export?

xTicker = win32api.GetProfileVal( "NewFeedItem" , "ItemMetadata/Category" , "" , configFilename )

This is not going to work :roll: Get the <tt>ItemMetadata</tt> value, and then parse it <u>as XML</u> to get the item category.

Otonicara wrote:2.) Which tag should be used in code bellow too capture Description. This is standard field however I do not find the filed in logfile.

I think you're guessing at how things are supposed to work. <tt>ItemDescription</tt> is not how you get an item's description. If you look at your log file, you can see the <tt>ItemContent1_Content</tt> field.

Otonicara wrote:HOOK INSPECTION: Log File
[NewFeedItem]
ItemTitle=CORRECTION FROM SOURCE: PlayBOX in Negotiations to Acquire New Visions Mobile%0A*0
ItemUrl=http://www.marketwire.com/mw/release.do?id=882770&sourceType=3
TimeCreated=1216986640
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>
ItemContent1_Content=LONDON, UNITED KINGDOM--(Marketwire - July 25, 2008)


ORIGINAL SOURCE INSPECTION:
<item>
<title>Telenor to appeal Siberian verdict in collusive lawsuit instigated by Alfa</title>
<link>http://www.marketwire.com/mw/release.do?id=890322&amp;sourceType=3</link>
<description>&lt;p&gt;OSLO, NORWAY--(Marketwire - August 16, 2008) - (Fornebu, Norway - August 16, 2008) A court in
the Siberian city of
Khanty-Mansiysk, Russia shortly after 2 am Saturday morning local
time issued a verdict holding Telenor liable for USD 2,824,125,677 in
damages plus RUR 460,000 in costs for allegedly having delayed
VimpelCom's acquisition of Ukrainian Radio Systems, a small Ukrainian
mobile operator. Telenor strongly believes the claimant Farimex is
affiliated with the Alfa Group and that the case has no merit.
Telenor is confident it will prevail in reversing the decision on
appeal.
</description>
<category>nasdaq:TELN</category>
<pubDate>Sat, 16 Aug 2008 03:38:00 EDT</pubDate>
</item>

The bit you've given from your log file doesn't match the bit you've given from the original feed (look at the titles and URL's).

Please write XML code sample ..

Posted: Fri Aug 29, 2008 9:15 am
by Otonicara
Please write XML code sample to extract field category from tag bellow:

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>

How this line should look like:
xTicker = win32api.GetProfileVal( "NewFeedItem" , "ItemMetadata/Category" , "" , configFilename )

Re: Please write XML code sample ..

Posted: Fri Aug 29, 2008 10:21 am
by support
Otonicara wrote:Please write XML code sample to extract field category from tag bellow:

The easiest way to extract the info is using XPath. Python doesn't come with XPath support built in but you can find libraries here. Lots of good XML tutorials can be found here.

Otonicara wrote:How this line should look like

Given that the first part of your question is referring to the <tt>ItemMetadata</tt> key, it should be clear that this is the key you need to retrieve.