Sunday evening to Monday morning… Pure development!
Throughout the whole of last week, I did not blog at all. Been lazy and putting gaming into priority only because depression clouded my thoughts. Mostly due to the one person who bought me to where I am today…
Keeping my mind occupied from all the depressing thoughts, I cover it with development, gaming or out with the friends… Being at home only makes me think deeper… Missed the simple life I once lived. Now it’s all so complicated! At first, I thought that being apart was the hardest thing I had to do. But when time passed, it’s fairly simple… Prioritise myself! Saying this, I think I am ready to move on…
Taking this leap forward, web development has been progressing fairly slow last week. In fact, I’ve only stared at code but no typing. I suppose I needed this time out from coding to reorganise my thoughts.
So starting PHP coding, I’ve started displaying JSON data onto a page for John. I collected a bunch of RSS feeds and stored it into my database as URLs. From there, all I did was use a while loop to read through the database and generate a feed!
$rss = simplexml_load_file($url);
With this piece of code, it was embedded with PHP5 which made things twice as easy to just extract the RSS and store it into my database in its respective attributes!
There were problems when it came to the dates since each RSS feed had shown a different format for each node which meant that I had to convert the date to be the same as what MySQL accepts for it to be treated as a date and time… And all I did was use:
This basically converts my date string to a series of numbers where it specifies a Linux timestamp. It is the number of seconds since the date January 1st 1970 00:00:00 UTC. Having this timestamp, all needs to be done is:
$published_on = date(“Y-m-d H:i:s”, strtotime($item->pubDate)); //returns “2012-11-26 23:01:00”
And voila! We have the time and date ready to be stored into the database!
Correctly doing this, what I plan to do next is to sort my JSON data by name and date (ascending or descending order). To command it, all John must do is type the URL with a variable at the end… Something like:
That should do the trick!
As for the update of data, I would like the RSS feed to inject the information into the database every 30 minutes. That way, each client doesn’t piss the database off causing it to crash! I’ll also work on this in parallel to the order on demand URL task…
When all is done, I can finally throw it on our domain for a test run! Hopefully there will be no problems. I’m guessing the only trouble I will bump into is probably the CRON job. Will I need to pay more for it? Lets see…
Well, coming to an end on this post, I’ll have to summarise it in a few sentences…
This post was mainly a log upon what I’ve done for my personal project and less about how I am feeling or what I’ve been doing for a while. What can I say? I’ve been busy trying to do a lot in my life and overflowing with thoughts in regards to my past but like I said in one of my posts before, it will come back to disturb me but I think last week was the killer! I spent the whole of the 7 days just thinking about it… Is it loneliness? Could it be that I am that weak? One thing is for certain, I will try to accomplish what I set off to do in the first place…Just do my projects and be on the lookout for that person…
Until then… There is always tomorrow… Quoted by Lyndsey (26/11/2012 at 23:49pm)