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

0 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.


Thursday, March 7, 2013

Windows Phone 8 App

0 Comments
I had my Windows phone 8 phone for some time now. And I only done some small tests with developing for Widows Phone 8 and it was very easy to get started.

But to really learn how to create apps on WP8 I need to create a complete app so I been trying to figure out what I should create. It does not have to be very useful for everyone. But it need to be something I would want to spent some time on and it should include network communication, Live Tile and some UI.

After thinking about it for a couple of days this is what I come up with.

I use AWStats get some of the web-statistics from my MultiCommander web site.
And I would be great if I could get this stats in my phone.

The problem is that AWStats does not have a web API. And I did not find anyone that created one so I would first need to create a way to deliver the data to the app.
I think I will try to create an API that return the AWStats data as JSON. And then consume the JSON data in the WP8 app and then show the data.

I also want a live tile that is update from a background task so I get some of the web-statistics directly on a tile.

I Think I will call the app "AWStats Viewer"

So I need to start with the server side and investigate how I can return AWStats data from the site to the app.

(To be continued..  Unless I give up..)

Friday, March 1, 2013

Multi Commander v3.0

0 Comments
V3.0 of Multi Commaner is finally out. It was planed to be out a while ago but I had so much to do so it got a bit delayed.

This released has over 360+ changes. Most changes will not be noticeable since they are internal core change that has been done to prepare for feature that will be added in the future.

I got a long list of thing I want to add. I just need the time to add them.

Read more and then download it