JulianUK
Posts: 36
Joined: Tue Feb 28, 2006 8:36 am
Location: London, UK
Contact:

Postby JulianUK » Tue Dec 08, 2009 10:42 am

Hi all

Can a channel report access the date I created a channel subscription? If so, how would I do it please?

I want to create a report that lists all the channels I've subscribed to in the last week, for incorporation into a "Follow Friday" blog post. (don't worry about the blog post bit, that's manual!)

thanks

Julian

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Tue Dec 08, 2009 9:58 pm

JulianUK, do you just want a list of the Channel Names subscribed to during a given period of time? Or the feed items from those Channels too?

I don't think there is a currently a Template Parameter for the date that a Channel was subscribed to, and I've looked at the new $/channels/list/ API and the subscription date isn't available either.

But I think there is a "Subscription date" value in the .CHANNEL files in your roaming data directory as:

Code: Select all

[State]
CreationTime=1241484594

That's probably in the strftime format.

So maybe Taka can add a Template Parameter or in a worse case scenario one could probably find all .CHANNEL files modified in the last week. Process each .CHANNEL file decoding the value of the [State] CreationTime back into a date format that us humans can understand and check if it was subscribed to within the last week. If it was, grab the value of the [State] LastFeed_DisplayName setting and write to your output file. It'd be a nice Application Plugin to fit into Awasu.

Disclaimer: Of course I'm not the expert of this, I'm just playing the "test your Awasu knowledge" game.

JulianUK
Posts: 36
Joined: Tue Feb 28, 2006 8:36 am
Location: London, UK
Contact:

Postby JulianUK » Wed Dec 09, 2009 3:24 am

kevotheclone wrote:JulianUK, do you just want a list of the Channel Names subscribed to during a given period of time? Or the feed items from those Channels too?

Just a list of channel names and URLs.

kevotheclone wrote:I don't think there is a currently a Template Parameter for the date that a Channel was subscribed to, and I've looked at the new $/channels/list/ API and the subscription date isn't available either.

But I think there is a "Subscription date" value in the .CHANNEL files in your roaming data directory as:

Code: Select all

[State]
CreationTime=1241484594

That's probably in the strftime format.

So maybe Taka can add a Template Parameter or in a worse case scenario one could probably find all .CHANNEL files modified in the last week. Process each .CHANNEL file decoding the value of the [State] CreationTime back into a date format that us humans can understand and check if it was subscribed to within the last week. If it was, grab the value of the [State] LastFeed_DisplayName setting and write to your output file. It'd be a nice Application Plugin to fit into Awasu.

Disclaimer: Of course I'm not the expert of this, I'm just playing the "test your Awasu knowledge" game.


Thanks, I'll take a look at the plugins, also it sounds like it might be quite straightforward to put together a script to directly query the .CHANNEL files....

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Wed Dec 09, 2009 4:23 am

JulianUK wrote:Can a channel report access the date I created a channel subscription?

Hey Julian, good to see you're still around :-)

It sounds like you're asking two questions:
(*) Is it possible to have a channel filter identify which channels have been newly-subscribed to (so that only they will be included in a report)?
(*) Is it possible to insert the time a channel was created into a report?

The short answer for both is "no", the long answer is "whoa, that gives me some really cool ideas!"

To expand on the short answer, the easiest way to get what you want is to configure your Awasu so that newly-created channels always get placed into a special folder, then run a report for everything in that folder. To set this up, open the Channel Wizard, click on the Defaults button and configure which folder to put new channels in. You would then have to periodically manually remove channels from this folder.

2.4.1.alpha1 added the ability to run a program after a report has been generated, so I guess you could use this to walk through your channel config files, identify the new ones, then remove everything except them from the report, but that would be getting deep into far-more-trouble-than-it's-worth territory.

But the idea it gave me was this: extend channel filters so that they can call an external program to determine if a channel should be included or not. In this case, a script could be invoked that checked the channel's config file to see if had been newly-created or not, thus controlling what channels got included in the report.

Templates could also be extended to recognize a new parameter, say <tt>{%RUN-APP% arg=42}</tt> that ran an external program and inserted its output into the resulting page.

This would work but starting a program each time you wanted to do this would be really slow, but Awasu now comes with Python embedded in it so it'd be straight-forward to let the user define a few lines of code as part of a report or a filter that did the necessary magic, and quickly... :cool:

JulianUK
Posts: 36
Joined: Tue Feb 28, 2006 8:36 am
Location: London, UK
Contact:

Postby JulianUK » Wed Dec 09, 2009 6:16 am

support wrote:
JulianUK wrote:Can a channel report access the date I created a channel subscription?

Hey Julian, good to see you're still around :-)


Hi Taka - yes, still a fan of the product!

I like the idea that Awasu has Python embedded so that a user can script with it - what version is that from?

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Wed Dec 09, 2009 9:04 am

JulianUK wrote:I like the idea that Awasu has Python embedded so that a user can script with it - what version is that from?

Python 2.5.2 was embedded at the end of the 2.3.x release cycle, but only for some internal use. However, the plan was always to make it available for embedded scripting such as what I described above.

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Wed Dec 09, 2009 8:37 pm

With all the cool new hooks to run a program you mentioned (Channel Filters & Channel Report Templates) I'm not sure if you confirmed you could provide a Template Parameter that would be available in Channel Report and API Templates?

Maybe {%CHANNEL-METADATA% SubscriptionDate}?

Using the $/channels/list API you could retreive the list of Channels in a tab-seperated format that you could import into Excel or a database to filter by date. And if you retreive the list of Channels in XML you can attach an XSLT style sheet that could filter/format the desired data.

Code: Select all

<?xml-stylesheet type="text/xsl" href="LastWeeksNewChannels.xsl"?>


Even though XSLT 1.0 doesn't have as much date processing power as XSLT 2.0, both can be extended with the Date and Time functions from the EXSLT library or the XSLT Standard Library.

Also, with MSXML you can embed and call JavaScript or VBScript code into your XSLT file using the <msxsl:script> Element. And if you install ActiveState's version of Perl or Python then you can embed Perl or Python code in XSLT too.

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Wed Dec 09, 2009 9:13 pm

kevotheclone wrote:With all the cool new hooks to run a program you mentioned (Channel Filters & Channel Report Templates) I'm not sure if you confirmed you could provide a Template Parameter that would be available in Channel Report and API Templates?

I was actually thinking you could write a bit of script to get this information yourself from the <tt>.CHANNEL</tt> file :-) but I guess creation date is useful enough to warrant it's own <tt>{%CHANNEL-METADATA%}</tt> parameter. I'll expose it in the API as well... :whip:

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Thu Dec 10, 2009 1:35 am

I didn't mean to pressure you into this; I know I've made my share of feature requests for awhile and you've put in a lot of work to fulfill them. I just got confused :? and wanted clarification.

So I guess I must have guessed correctly about the [State] CreationTime in the .CHANNEL files and the strftime format.

By the way, I'll email you an update to the "Categories Cloud" Channel Report Template that I've been working on. It's still not complete, but it's got an interesting update that I think you might like.

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Thu Dec 10, 2009 9:07 am

kevotheclone wrote:I didn't mean to pressure you into this; I know I've made my share of feature requests for awhile and you've put in a lot of work to fulfill them. I just got confused :? and wanted clarification.

Nah, just having a go at ya :-)

kevotheclone wrote:So I guess I must have guessed correctly about the [State] CreationTime in the .CHANNEL files and the strftime format.

Awasu always stores times as time_t values i.e. seconds since 01/01/70 00:00:00. When <tt>{%CHANNEL-METADATA%}</tt> is updated to return the channel creation time, you'll be able to format it using strftime-style parameters but if you grab it straight from the <tt>.CHANNEL</tt> file, it'll be a raw time_t value.

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Sat Dec 12, 2009 4:51 pm

support wrote:Nah, just having a go at ya :-)

Ya got me!

Ok, how's this look for a raw prototype of a "Channel Filter Plugin" or whatever it's official name might become. This might do what JulianUK wants; it writes a comma delimited list of the Local Channel IDs of the Channels that have been subscribed to in the last 7 days from the date/time that the "Channel Filter Plugin" is called.

Of course this simple example features hard-coded values like the path to the local data files (*.CHANNEL), that should be modified or made dynamic. But it's just an simple example to help visualize Taka's new idea.

Code: Select all

import datetime
import win32api

channelDir = "C:\\Documents and Settings\\UserName\\Application Data\\Awasu\\Channels\"

localChannelIDs = []
oneWeekAgo = datetime.date.today() - datetime.timedelta(days=7)

for name in os.listdir(channelDir):
    fullPath = os.path.join(channelDir, name)
    if os.path.isfile(fullPath):
        if name.endswith(".channel"):
            creationTime = datetime.date.fromtimestamp(float(win32api.GetProfileVal("State", \
                                                                                    "CreationTime", \
                                                                                    "", \
                                                                                    fullPath)))
            if creationTime >= oneWeekAgo:
                localChannelID = win32api.GetProfileVal("Config", "LocalChannelId", "", fullPath)
                localChannelIDs.append(localChannelID)

print ",".join(localChannelIDs)

stanislarr

Postby stanislarr » Wed Mar 17, 2010 6:36 am

For example

Ome subscrible page for normal user to add them into a list - with the normal workflow - subscrible - getting confirmation mail - confirmed

and

One subscrible page for marketing or sales manager with a hidden parameter - confirmed = yes, So that manager can add other users direct by sending a webfom

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Wed Mar 17, 2010 6:57 am

It's not quite clear what you're looking for. Could you explain a bit more...?


Return to “Awasu - Feature Requests”

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests