Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS / XML export #7

Closed
electerious opened this issue Nov 18, 2020 · 10 comments
Closed

RSS / XML export #7

electerious opened this issue Nov 18, 2020 · 10 comments
Assignees
Labels
feature_request New feature or request

Comments

@electerious
Copy link

Is your feature request related to a problem? Please describe.

I just thought that it would be cool to get a daily Ackee report in my RSS reader.

Describe the solution you'd like

ackee-report rss or ackee-report xml command that generates a RSS feed you can subscribe to. You just need to place the file into an accessible folder (probably protected) and subscribe to it.

@BetaHuhn BetaHuhn added the feature_request New feature or request label Nov 18, 2020
@BetaHuhn
Copy link
Owner

That's a great idea!

You just need to place the file into an accessible folder (probably protected) and subscribe to it.

So should ackee-report just generate the RSS feed and output it to a file the user specifies? If so, how does the subscribing work?

Also, how should the RSS feed be structured, one item for each domain?

@BetaHuhn BetaHuhn self-assigned this Nov 18, 2020
@electerious
Copy link
Author

electerious commented Nov 19, 2020

So should ackee-report just generate the RSS feed and output it to a file the user specifies? If so, how does the subscribing work?

You just need to place the file in a public folder. Every well-formatted RSS file can be subscribed with a client via the URL. Here's a simple example from one of my sites: https://coffee.electerious.com/feed.xml

Generating the file should be enough.

Also, how should the RSS feed be structured, one item for each domain?

Not sure what's the best way. Maybe one news item for each domain per day?

@BetaHuhn
Copy link
Owner

BetaHuhn commented Nov 19, 2020

Maybe one news item for each domain per day?

For this I need to expand ackee-report to work with different intervals, as it currently only uses the monthly data (which I wanted to do anyways).

Right now it uses the getDomain query, but I noticed the Ackee UI uses a fetchOverview query which is not documented in Ackee's Docs. What's the difference between the two?

Here's how the feed currently looks (on the feature/rss-feed branch):

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>Ackee Report</title>
        <link>https://ackee.example.com</link>
        <description>Here is your report for example.com and example2.com</description>
        <lastBuildDate>Thu, 19 Nov 2020 17:57:53 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>ackee-report</generator>
        <language>en</language>
        <item>
            <title><![CDATA[example.com]]></title>
            <link>https://ackee.example.com</link>
            <guid>https://ackee.example.com</guid>
            <pubDate>Thu, 19 Nov 2020 17:57:53 GMT</pubDate>
            <description><![CDATA[<p><b>Average views per day</b></p><p>x</p><p><b>Average duration</b></p><p>x s</p><p><b>Views this month</b></p><p>x</p><p><b>Top Pages</b></p><p>https://example.com - x times</p><p>https://example.com/path - x times</p><p><b>Top Referrers</b></p><p>https://example.com - x times</p><p>https://example2.com - x times</p><p>https://example3.com - x times</p><p><b>Top Languages</b></p><p>English - x times</p><p>German - x times</p>]]></description>
        </item>
        <item>
            <title><![CDATA[example2.com]]></title>
            <link>https://ackee.example.com</link>
            <guid>https://ackee.example.com</guid>
            <pubDate>Thu, 19 Nov 2020 17:57:53 GMT</pubDate>
            <description><![CDATA[<p><b>Average views per day</b></p><p>x</p><p><b>Average duration</b></p><p>x s</p><p><b>Views this month</b></p><p>x</p><p><b>Top Pages</b></p><p>https://example.com - x times</p><p>https://example.com/path - x times</p><p><b>Top Referrers</b></p><p>https://example.com - x times</p><p>https://example2.com - x times</p><p>https://example3.com - x times</p><p><b>Top Languages</b></p><p>English - x times</p><p>German - x times</p>]]></description>
        </item>
    </channel>
</rss>

@electerious
Copy link
Author

Right now it uses the getDomain query, but I noticed the Ackee UI uses a fetchOverview query which is not documented in Ackee's Docs. What's the difference between the two?

It's just the name of the query. You can query multiple fields at once in GraphQL and give the whole thing a name. Those names are optional and the Ackee docs only contain a few example queries. E.g. You could also combine getDomainsFacts and getDomainsStatistics and call it getStats.

@BetaHuhn
Copy link
Owner

It's just the name of the query

Oh okay, that makes sense. I am still new to GraphQL 😄

@BetaHuhn
Copy link
Owner

This feature is now a part of v0.6.0. You can generate a rss feed/xml file with the rss command:

ackee-report rss -d example.com -o /path/to/public/folder/feed.xml -r day

Note: The -r option changes the data range from month to day.

@electerious
Copy link
Author

It works 🙌 Here's how it looks for one of my sites:

Lychee

I guess that the feed will always contain a single item, but that shouldn't be a problem as the feed reader should recognise that it's a new item. Old items aren't relevant in this case.

Thanks!

@BetaHuhn
Copy link
Owner

Great!

Just out of curiosity, what reader are you using for RSS feeds?

@electerious
Copy link
Author

It's Feedly.

Two more ideas:

  • Pages and referrers could be links
  • How about sentences in reports? The feed could contain something like: You had a total amount of 328 views. That's x% below the average. The duration was x% above the average 134s with 230s. It's a idea I'm also exploring for the Ackee dashboard. Not sure if it works or if it will ever make it into the dashboard, but I still find it very interesting.

@BetaHuhn
Copy link
Owner

Pages and referrers could be links

Yes, this is next on my list of improvements.

How about sentences in reports?

I think this would be great to include in the reports. Maybe at the top of the email report/as the description in the feed. I will have to take a closer look at how this can be done with the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants