Otonicara
Posts: 36
Joined: Sun Jul 13, 2008 3:40 pm
Location: Slovenija EU
Contact:

Postby Otonicara » Sun Aug 17, 2008 3:41 pm

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>

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Sun Aug 17, 2008 5:25 pm

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).

Otonicara
Posts: 36
Joined: Sun Jul 13, 2008 3:40 pm
Location: Slovenija EU
Contact:

Postby Otonicara » Fri Aug 29, 2008 9:15 am

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 )

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Fri Aug 29, 2008 10:21 am

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.


Return to “Awasu - General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest