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

Automatically provide simple RSS export for all Piwik widgets #5571

Closed
mattab opened this issue Mar 18, 2008 · 14 comments
Closed

Automatically provide simple RSS export for all Piwik widgets #5571

mattab opened this issue Mar 18, 2008 · 14 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@mattab
Copy link
Member

mattab commented Mar 18, 2008

All data is already available though RSS feed.
Example: http://piwik.org/demo/?module=API&method=Referers.getKeywords&idSite=1&period=day&date=last10&format=rss
The problem is that these feeds provide the “plain data” and don’t have CSS, nice colors, etc.

We can export the HTML from widgets output for each day or website requested, and put this html in the rss feed.

The reports could be made available through a RSS link below each widget. The feature could also be made visible in the “Widgets” page, just like users can now export widgets in iframe.

Note: some widgets would disable the automatic RSS conversion as it is not applicable, eg. the Live! widget that shows the latest visits on the website.

During the RSS conversion, all Javascript includes would be removed to only leave the html. To what extent can styles apply? I wonder if the RSS reader keep no style at all, or maybe the inline css?

@mattab
Copy link
Member Author

mattab commented Jul 29, 2010

Note: this could/should now use the Metadata API which will return the data ready to be displayed. This would be rather simple to build now! See example how PDF is created.

https://github.com/piwik/piwik/blob/master/plugins/PDFReports/API.php#L181

The interesting API is the metadata API, eg. http://demo.piwik.org/index.php?module=API&method=API.getProcessedReport&idSite=1&date=yesterday&period=day&apiModule=UserCountry&apiAction=getCountry&format=xml

@mattab
Copy link
Member Author

mattab commented Jan 17, 2011

Once we have HTML of all Widgets, we can easily have an option that "Email Reports" can contain HTML as well as PDF (a nice side effet of building this feature)

@julienmoumne
Copy link
Member

I'm going to implement /trac/ticket/2318 before working on this ticket.

@julienmoumne
Copy link
Member

Before starting development on this ticket I'd like to clarify a few points.

The new RSS functionality departs from the old one by using the Metadata API. Because some widgets may not publish metadata reports, the new RSS functionality can not be applied broadly to all Widget footers.

  • Do we agree on dropping RSS as an API response format? If yes, we would do a rss redirect something like this when an API is called with format=rss.
  • RSS icons in widget footers will now be conditionally displayed. Should we query API.getReportMetadata and compare with the plugin name and controller action ? There may be some renaming if they don't match the module and action names in the metadata report. Or is it ok to use (with reversed logic, ie. false by default)
$this->viewProperties['show_export_as_rss_feed'] = true;
  • The new RSS functionality will be implemented as a new plugin and will only publish APIs (no new widgets, no new pages).

@mattab
Copy link
Member Author

mattab commented Apr 25, 2011

Good analysis.

I don't think we need a new plugin for this functionnality. Let's integrate it in core directly, or CoreHome, or elsehwere..?

OK to drop RSS as a datatable format. Don't bother about RSS redirect, we can simply state the API change in changelog.

Regarding the flag, $this->viewProperties['show_export_as_rss_feed'] sounds good. However, it must be set automatically, based on API.getReportMetadata indeed.

I think that controller.action and API.action all match, but it is well possible that some of them don't. Renaming should be OK (maybe it will remove the widgets from the dashboard, and/or from the PDF/HTML reports already setup, but maybe not). As long as things that 'had' the report before renaming, are not broken by the renaming, it is fine to rename -hope it makes sense hehe ;)

@mattab
Copy link
Member Author

mattab commented Apr 28, 2011

Also, see #1664 which has suggestion around proper RSS pubdates

@julienmoumne
Copy link
Member

Should I use the Zend framework RSS builder ? Or are we trying to lessen dependencies to this framework ?

@robocoder
Copy link
Contributor

If you can use the Zend_Feed module (already in trunk), please do. It's underutilized at the moment (e.g., ExampleFeedBurner).

@julienmoumne
Copy link
Member

I am currently building the API method which will generate the RSS stream.

For normal RSS usages, correct behavior/value for the $date parameter is 'previousX', ie. 1 RSS entry equals 1 complete period.

Should the API allow a less restrictive approach and let the API caller set values for $date ?

In this case, what is the expected behavior if $date equals '05/01/2011' ? Should the RSS stream contain only one (probably partial) report ?

What about date ranges? Should it behave like previousX ? Or should it output only one entry?

My opinion is not to allow $date parameter to be overridden and to fix it to previousX. X being hard coded or configured in global configs.

@mattab
Copy link
Member Author

mattab commented May 1, 2011

I would agree with your proposal: simple is better. RSS will be used to get updates in the feed reader, so no need to handle past dates (users can use other formats such as XML for past dates).

By default, maybe X can be quite high (50 entries?).

@julienmoumne
Copy link
Member

(In [4879]) fixes #2414 refs matomo-org/matomo-mobile-2#2350 refs #5571 - metadata support for previousN/lastN

@julienmoumne
Copy link
Member

(In [4900]) refs #2414 #2350 #151 - fix for bug introduced on json arrays and objects + adding first layer of unit tests

@mattab
Copy link
Member Author

mattab commented Nov 23, 2011

There have been good improvements made in #2714 and now, Column names are translated. Still not as pretty as Piwik report, but quite good for RSS as it is.

@mattab
Copy link
Member Author

mattab commented Mar 11, 2012

The implementation could reuse the HTML reports templates.

Also, the &format=html could use this "pretty table" view. Then, the RSS export would use the HTML renderer. This would add 2 new features at the same time (pretty RSS reports, and lightweight HTML embed reports).

Depends on #3031

@mattab mattab added this to the Future releases milestone Jul 8, 2014
@mattab mattab removed P: low labels Aug 3, 2014
@mattab mattab closed this as completed Feb 19, 2015
@mattab mattab added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Feb 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

3 participants