Skip to main content

Grabs hits, views and popular content based on awstats data and presents this information in the context of your Plone site. Provides a “Popular Content” portlet for displaying popular content from awstats.

Installation & Usage

Add collective.awstats_hitcounter to your buildout and re-run bin/buildout

Then install on your plone site under “Site Setup” > “Add-ons”

Once this is installed you know have the facility to dynamically pull in a counter.

Configuration

After installation configure your awstats url. You can do so by going to Site Setup > Awstats HitCounter Settings.

https://raw.githubusercontent.com/collective/collective.awstats_hitcounter/master/sitesettings.png

Set the absolute url to look similar to this:

https://raw.githubusercontent.com/collective/collective.awstats_hitcounter/master/configure_url.png

Debugging with DUMP_RAW_AWSTATS_URLS

Sometimes you want to make sure things are working. The following can be done on a non-production server.

DO NOT DO THIS ON A PRODUCTION SERVER.

Launch the instance with the env var DUMP_RAW_AWSTATS_URLS as follows:

DUMP_RAW_AWSTATS_URLS=1 bin/instance fg

This tells the system to skip comparing awstats values to the site catalog. Effectively you’ll just get a ‘raw’ dump of the URLs returned from AWSTATS. This is very useful for troubleshooting and diagnosing if scraping is working at all.

Usage

collective.awstats_hitcounter adds a viewlet with the id ‘awstats_hitcounter’ which pulls in the stats from awstats.

Add this javascript at the bottom of pages where you want the counter to show:

$("#awstats_hitcounter").load(window.location.pathname + "/@@awstats_hitcounter_view")

The screenshot below illustrates the expected behaviour

https://raw.githubusercontent.com/collective/collective.awstats_hitcounter/master/awstats_hitcounter_screenshot.png

0.1.6

  • add on listens for the existence of the env var DUMP_RAW_AWSTATS_URLS, useful for testing and troubleshooting

  • @@popular_content_view can now be configured to say how many items should show on the page. This setting is managed in the registry. The default value is 150.

0.1.5

  • added a popular content view

  • added a popular content portlet

  • added a content type whitelist to the portlet

  • added a url black list to the portlet

  • added an option to filter out direct downloads from the portlet

0.1.4

  • added support for hits (not just page views) [pigeonflight]

0.1.3

  • moved the stats viewlet to the top of the portal footer viewlet manager [pigeonflight]

0.1.2

  • fixed a problem with the way the path was retrieved [pigeonflight]

  • now counts downloaded attachments different from views [pigeonflight]

0.1.1

  • moved the hitcounter viewlet to the viewlets.IPortalFooter

  • added custom app.js which asynchronously pulls stats from the ‘awstats_hitcounter_view’

  • the stats view now returns the content type, creation date and number of views [pigeonflight]

  • update to use BeautifulSoup for scraping awstats [pigeonflight]

0.1

  • Initial release. [pigeonflight]

Release files for collective.awstats_hitcounter 0.1.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.awstats_hitcounter 0.1.6.1
File Size Uploaded
collective.awstats_hitcounter-0.1.6.1.tar.gz 31.4 kB Details

Release files / collective.awstats_hitcounter-0.1.6.1.tar.gz

Download URL collective.awstats_hitcounter-0.1.6.1.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
03aef54ae8f8c46de6c1b18941a7b341b973c5ef4cb15794c5ca8d7c6b7dc23c
BLAKE2b-256 checksum
How to use checksums
8a394784b005ce1cf2d9295ebf79881eba9edb1edbc32fd16f7416d66d524a4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.6.1 This release

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page