View unanswered posts | View active topics

Reply to topic  [ 11 posts ] 

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post RealTime Export to MC Access
I would like to setup real-time Channel Export to MC Access. Process will be triggered in hook immediately when new feed would arrive. You have plagin for MYSQL. Is anything as such for MC Access?


Sun Jul 13, 2008 11:51 am
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: RealTime Export to MC Access
Otonicara wrote:
I would like to setup real-time Channel Export to MC Access. Process will be triggered in hook immediately when new feed would arrive. You have plagin for MYSQL. Is anything as such for MC Access?

Not right now, although it would be fairly easy to write one. You could either write one to export to CSV and then import that into Access. Or, if you want to update the database directly, ODBC would probably be the way to go. A bit more involved but still straight-forward.


Sun Jul 13, 2008 4:10 pm
Profile WWW

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post Please Check the code ..
Could you check bellow code and advise where is the problem to be able to insert new news item into MC Access.

1.) In hook file: Are Data Types ok? Can I use Memo instead of String?
2.) In hook file: Is event ok-ej?
3.) In vb file: Are reading of INI data ok-ej (NAME,DESCRIPTION,URL,PUBLISHED)?

Cheers, Ales

************************
.HOOK file
________________________

[Config]
ScriptFilename=ExportToAccess.vb
DisplayName=Export Data to Access.mdb
AuthorName=otonicara
AuthorEmailAddress=ales@otonicar.com
Notes=Export News to Access plus run sub vbcode for further stock data checking
ExtraArgs=

[Events]
NewFeedItem=1

' --------------------------------------------------------------------

[ChannelParameterDefinition-1]
Name=Name
Type=string
DefaultValue=
Description=News Title

[ChannelParameterDefinition-2]
Name=Description
Type=string
DefaultValue=
Description=News Description


[ChannelParameterDefinition-3]
Name=URL
Type=string
DefaultValue=
Description=News Link


[ChannelParameterDefinition-4]
Name=Published
Type=string
DefaultValue=
Description=Published Time

_____________________________________
ExportToAccess.vb file
______________________________________

Dim configFilename As String
Dim NAME As String
Dim DESCRIPTION As String
Dim URL As String
Dim PUBLISHED As String

import sys
import win32api

' ???? Is this currect for VB code ????
' get the name of the INI file
configFilename = sys.argv[1]

' ???? Is this currect for VB code ????
' get our channel parameters
NAME = win32api.GetProfileVal( "ChannelParameters" , "Name" , "" , configFilename )
DESCRIPTION = win32api.GetProfileVal( "ChannelParameters" , "Description" , "" , configFilename )
URL = win32api.GetProfileVal( "ChannelParameters" , "URL" , "" , configFilename )
PUBLISHED = win32api.GetProfileVal( "ChannelParameters" , "Published" , "" , configFilename )


Sub AccessImport(NAME,DESCRIPTION,URL,PUBLISHED)

set MyDB = CreateObject("ADODB.Connection")
MyDB.Open "StockNewsODBC"

Dim SQLString
SQLString ="INSERT INTO TBL_StockNews (Title,Description,Link,PublishTime) VALUES ('" & NAME & "','" & DESCRIPTION & "','" & URL & "','" & PUBLISHED & "')"
set Action = MyDB.Execute(SQLString)
MyDB.Close
End Sub


Tue Jul 15, 2008 8:45 am
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: Please Check the code ..
Otonicara wrote:
1.) In hook file: Are Data Types ok? Can I use Memo instead of String?

Awasu's channel hook infrastructure is designed to allow hooks to be written in any language, so it doesn't make sense for it to accept VB-specific things like Memo. "string" is what you need to use.

Otonicara wrote:
2.) In hook file: Is event ok-ej?

This is OK.

Otonicara wrote:
3.) In vb file: Are reading of INI data ok-ej

You seem to have inserted Python code into your VB program which really isn't going to work too well.


Tue Jul 15, 2008 9:29 am
Profile WWW

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post 3.) ...
Which is the currect insert for VB to read INI values? Pyton is the only insert I found on your web help...


Wed Jul 16, 2008 4:28 am
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: 3.) ...
Otonicara wrote:
Which is the currect insert for VB to read INI values?

Try here.


Wed Jul 16, 2008 4:43 am
Profile WWW

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post 3.) Reading INI file v VB code ..
I still didn't find the right command. Could you writte this few important lines to make hook finaly working.. PLEASE! Where on PC this ini is phisickly located?


Wed Jul 16, 2008 8:28 am
Profile WWW

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post Check the function ..
Is bellow what is needed? Please check? Where is ini file located? Is sign(1) after the name of the file necessary?

Function is taken from link
http://www.vbexplorer.com/VBExplorer/fo ... torial.asp

**********************
Declare Function GetPrivateProfileSection Lib "kernel32" _
Alias "GetPrivateProfileSectionA" _
(ByVal sSectionName As String, _
ByVal sReturnedString As String, _
ByVal lSize As Long, _
ByVal sFileName As String) As Long

sSectionName = ChannelParameters
sReturnedString = Name
ISize = 250
'INI Name and file location ????
SFileName = sys.argv
NAME = sReturnedString

sSectionName = ChannelParameters
sReturnedString = Description
ISize = 10000
'INI Name and file location ????
SFileName = sys.argv
DESCRIPTION = sReturnedString

sSectionName = ChannelParameters
sReturnedString = URL
ISize = 1000
'INI Name and file location ????
SFileName = sys.argv
URL = sReturnedString

sSectionName = ChannelParameters
sReturnedString = Published
ISize = 50
'INI Name and file location ????
SFileName = sys.argv
PUBLISHED = sReturnedString


Wed Jul 16, 2008 8:57 am
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: 3.) Reading INI file v VB code ..
Otonicara wrote:
Where on PC this ini is phisickly located?

The location of the INI file is passed as a command-line parameter.


Wed Jul 16, 2008 10:37 am
Profile WWW

Joined: Sun Jul 13, 2008 11:40 am
Posts: 36
Location: Slovenija EU
Post Summery ..
The main idea is to be able to do online feed export from Chanel to Access Data base. There is no sample to do this on your help system. I assume this would be usefull future also for many other Awasu users. I bought Awasu professional Edition mainly becouse of your keywords seek and hook control! These two functionalities makes Awasu World top RSS reader at least for me! The questions are as followes:

1.) In case feed provide additional metadata: Is it possible to use all additional metadata in feed export to Access? For Example beside standard data: Title, Desription and URL I would also like to export stock ticker which is stored in column »category«.

Let's try feed bellow in MC Explorer (enter the link bellow to MC Exporer URL) you will see on the right of the screen categories. I would like to use this data in Awasu Export too..
http://new.marketwire.com/rss/BreakingN ... nglish.xml

You replied that bellow can be set:
http://www.awasu.com/help/2.3/hh_start. ... dules.html
a.) In case above is selected: Are all those fields can be used also in a hook?
b.) In case there are other matadata not listed on the link above: Is possible to use these additional fields in a hook - ini file data store?

2.) According to Awasu userguide, hook data exports using ini file philosphy. The question is: What is the name of the file and Where on file system the file is stored? I would like to open the file with Wordpad to see what is inside. Of course I need also to specify in vb code the name and location of that file.

In your Pyton example sys.argv[1] is used. I can not find anything with such name on my PC.

import sys
import win32api

# get the name of the INI file
configFilename = sys.argv[1]

In short what should be written in vb code (look bellow configFilename=) to open the file Awasu is using for Data Exports.

Regarding Awasus file system you provided the file locations list:
http://www.awasu.com/help/2.3/hh_start. ... ayout.html

However I can not locate ApplicationData directory (XP). What needs to be done to come to this (probably some file filtering is on)? Plus which file there is so called ini for data transfer?

Your software is great. Not being able to master hook functionality is not acceptable as this is realy cool thing! I DO HOPE we will finally beat the problem. The quickes will be if you directly amand the code bellow and let me know where ini file can be find to be able to open it with Notepade..

vb code:
Dim configFilename As String
Dim NAME As String
Dim DESCRIPTION As String
Dim URL As String
Dim PUBLISHED As String
Dim CATEGORY As String
Dim ConfigFilename As String


'Function for reading data from INI file
Declare Function GetPrivateProfileSection Lib "kernel32" _
Alias "GetPrivateProfileSectionA" _
(ByVal sSectionName As String, _
ByVal sReturnedString As String, _
ByVal lSize As Long, _
ByVal sFileName As String) As Long


' get the name of the INI file
configFilename = sys.argv[1]


' get channel parameters
NAME = GetprivateProfileSection("ChannelParameters","Name",100,configFilename)
DESCRIPTION = GetprivateProfileSection("ChannelParameters","Description",10000,configFilename)
URL = GetprivateProfileSection("ChannelParameters","URL",1000,configFilename)
PUBLISHED = GetprivateProfileSection("ChannelParameters","Published",50,configFilename)
CATEGORY = GetprivateProfileSection("ChannelParameters","Category",50,configFilename)

'DataBase Connection
set MyDB = CreateObject("ADODB.Connection")
MyDB.Open "StockNewsODBC"

'SQL Query
Dim SQLString
SQLString ="INSERT INTO TBL_StockNews (Title,Description,Link,PublishTime,Ticker) VALUES ('" & NAME & "','" & DESCRIPTION & "','" & URL & "','" & PUBLISHED & "', '" & CATEGORY & "')"
set Action = MyDB.Execute(SQLString)
MyDB.Close
End Sub


Hook:
[Config]
ScriptFilename=ExportToAccess.dll
DisplayName=Export Data to Access.mdb
AuthorName=otonicara
AuthorEmailAddress=ales@otonicar.com
Notes=Export News to Access plus run sub vbcode for further stock data checking
ExtraArgs=

[Events]
NewFeedItem=1
ConsolidatedNewFeedItems=1

' --------------------------------------------------------------------

[ChannelParameterDefinition-1]
Name=Name
Type=string
DefaultValue=
Description=News Title

[ChannelParameterDefinition-2]
Name=Description
Type=string
DefaultValue=
Description=News Description


[ChannelParameterDefinition-3]
Name=URL
Type=string
DefaultValue=
Description=News Link


[ChannelParameterDefinition-4]
Name=Published
Type=string
DefaultValue=
Description=Published Time


[ChannelParameterDefinition-5]
Name=Category
Type=string
DefaultValue=
Description=News Stock Ticker


Fri Jul 18, 2008 5:44 am
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: Summery ..
Otonicara wrote:
In case feed provide additional metadata: Is it possible to use all additional metadata in feed export to Access? For Example beside standard data: Title, Desription and URL I would also like to export stock ticker which is stored in column »category«.

Yes. <tt>category</tt> is a standard RSS tag and so Awasu will automatically extract it and pass it on to channel hooks. If there is other information embedded in the feed using non-standard tags, you need to write a metadata module first to extract it.

Otonicara wrote:
In case above is selected: Are all those fields can be used also in a hook?

If you're talking about the stuff in the item descriptions, it's possible but the way they've set up their feed is not too good and you would probably be better off writing a custom channel plugin to parse it.

Otonicara wrote:
In case there are other matadata not listed on the link above: Is possible to use these additional fields in a hook - ini file data store?

If the information is not in the feed, how is Awasu supposed to get at it?

Otonicara wrote:
According to Awasu userguide, hook data exports using ini file philosphy. The question is: What is the name of the file and Where on file system the file is stored? I would like to open the file with Wordpad to see what is inside. Of course I need also to specify in vb code the name and location of that file.

Again, the location of the INI file is passed as a command line argument. It is a temporary file and exists for only as long as the channel hook is running. Once the hook finishes, Awasu deletes the file since it is no longer needed.

Otonicara wrote:
In your Pyton example sys.argv[1] is used. I can not find anything with such name on my PC.

This is not the name of a file, this is how you get at the command line arguments in Python. You need to find out how to do the same thing in VB (none of us here are VB programmers so you need to go to Google).

Otonicara wrote:
Regarding Awasus file system you provided the file locations list:
http://www.awasu.com/help/2.3/hh_start. ... ayout.html

However I can not locate ApplicationData directory (XP).

Read the footnotes for what's probably happening.

I would strongly suggest you install Python so that you can run the LogChannelActivity hook. This will give you a feel for how hooks work and it also has an option to dump the INI files so you can easily see what Awasu passes in for each event. If you do this, you will also need to install the WIN32 extensions (Google for "win32all").


Fri Jul 18, 2008 8:43 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online
Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 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:  
cron