Showing posts with label AWStats. Show all posts
Showing posts with label AWStats. Show all posts

Saturday, May 11, 2013

AWStats Viewer for Windows Phone 8

0 Comments
My Windows Phone 8 app for showing AWStats is starting to work now now.

Why

This is my first Windows Phone app and I learned a lot from it. (More about that in another post)
The main goal with this app has been to learn the API and how development on Windows Phone 8 works.

It was quite easy to get started and get started. It might be because I already know my way around Visual Studio and I already know C# and done some apps in XAML before.
Also the emulator is fast and easy to setup and use and debugging to the phone is also painless.

The App

When you start the app the first time you need to add what site you want to view (Multiple sites are supported)
If an site is configured it will go to that site and get the AWStats information. It will cache the stats in the phone and it will refresh it unless it is over 30min old. You can however force a refresh in the ... menu

The main page is showing the month summary for the site and you also got a previous/next arrow there for moving to stats for other months.
If you swipe to the "day" page you will get some day by day stats. The "pages" page will show the top 20 accessed pages and how many hits it has and it will also calculate a day average.  And the last page show "externals" this is top 20 external links to your sites.


More stats pages are planed like browser and OS stats. But I have not had the time to add that yet.

Under the ... menu you get command to refresh current stats and you can also go to the "sites" page where you configure what site it can access and the URL for it.


The site summary command will fetch months stats for the entire year and show a month by month stats.
and if you press the ... menu on that page you can request to fetch even more and get previous year and so on. All this "old" stats will be saved and cached in the phone so it will only fetch them once.

Live Tile

Under settings you can configure the live tile. Activate if it should update the tiles in the background, what information from what site it should show. Multiple live tiles are supported.
Live tiles of all sizes are support.


Features


  • Multiple sites
  • Caches history data and current data
  • Small,Medium and Large live tile support
  • Live tile can be customized in color and information it should show
  • Fast and fluid layout

To Do

There is still some things to add and fix. Adding Browser and OS stats is one thing. and if possible I would like to add a domain (country) stats.
Also some minor thing need to be fixed. But I will wait with adding them and run this for a couple of month and see what else I want to add. Also I have a lot of work planed for my other projects, So I do not have more time at the moment to spend on this.

Windows Phone App Store

The app is not available on the Windows Phone Store yet, And I'm not sure it will be. Also the demand for an app like this is very limited. Only web master that run AWStats and that owns a Windows Phone 8. I think I can count all of them on one hand.
This app has been a great learning project for me. But I will try to release it if I get the time.
If you are interested in this app let me know and I might actually put some time into finishing it.



Sunday, March 17, 2013

AWStats API v0.9 (First Look)

1 Comments
The AWStats API is now starting to work.

It is a simple php script that you place somewhere on you website and this script will return the AWStats data as json.

As an example say that you place the script getawstats.php on your site lets call it example.com, then when you access http://example.com/awstats/getawstat.php you can get the following data

{"summary":{"year":"2013","month":"04","lastupdate":"20130410075001","uniques":"27423","visits":"60031","pages":152305,"hits":708106,"bandwidth":118969674567},"days":[{"day":1,"pages":10662,"hits":50642,"bandwidth":4577570523,"visits":5086},{"day":2,"pages":11969,"hits":46479,"bandwidth":3942706134,"visits":6325},{"day":3,"pages":14303,"hits":55780,"bandwidth":8044779500,"visits":6415},{"day":4,"pages":34091,"hits":217563,"bandwidth":47562300844,"visits":9528},{"day":5,"pages":21942,"hits":109844,"bandwidth":18326884056,"visits":7771},{"day":6,"pages":16759,"hits":63628,"bandwidth":11206302251,"visits":6731},{"day":7,"pages":12302,"hits":48495,"bandwidth":8123735971,"visits":4993},{"day":8,"pages":12060,"hits":43136,"bandwidth":7246989597,"visits":5119},{"day":9,"pages":15968,"hits":64832,"bandwidth":8986186671,"visits":6940},........ and so on

Saturday, March 9, 2013

Creating a AWStats API

1 Comments
For my AWStats Viewer app for WP8 I need to be able to get the web statistic from the website some way.
I do not want the app to parse the AWStats webpage since since it does not show all the information I want. I need the data from the AWStats data files. Not all of it but I need it unmodified.

But the data files can be very large and having the app get fetch the data file and parse it is not a good idea.
Because download several MB of data everything the app need to update is not god. It would be slow and require a lot of memory also background task have a memory limit.

What I need is a Web API. I need to be able to send a query the website and have it return the result as JSON.

The Webserver is running PHP so from PHP I need to read and parse the AWStats Data file and extract the information that is wanted and place create some JSON data from it and return it.

I search the net for some PHP class that would parse the AWStats data and I found awparser that is made by Javier Infante.

The AWParser class is not perfect, It does not extract all information I need and it stores the data in a way that is not optimal for my needs, But I will be able to modify it easily so I think I can make it work for me.

After that I will have all the AWStats data in PHP arrays and php can convert arrays to JSON with json_encode(..) so it would be easy to return the data as JSON.

So when I created this API I will publish the API on my website so anyone can install it on their own site if they want to develop own app for it or use my Awstats Viewer app in the future.