The following are the blog posts tagged as php
echo
May
29
2010

Summer of Code

Summer isn’t over yet but I’m afraid that this summer season will be my first summer without experiencing saltwater.

I spent most of my summer taking summer classes (Physics 72 and PE 2 Weight Training). Aside from that, I spent a some chunk of my time in DilNet Help Desk answering phone techs, fixing networking problems on-site and fooling around with my co-applicants and student assistants. I also attended some interest-related events such as the UnPLUG Precinct Mapping Party and Ubuntu 10.04 Release Party.

The final leg of my summer, for me, was the most exciting. I accidentally got involved in a project while eating with my DilNet friends at a food stall near the Main Library. We had to develop an application to be used by a unit in UP.

Developing the app was exciting. Although I had previous experience with CodeIgniter (a PHP web-app framework that uses the MVC architectural pattern), it was my first time to use it for an actual project. It was my first time to use jQuery since the project required some realtime checking of constraints.

I also experienced roadblocks in making my part of the project. Three days before the deadline everything I coded for around a week got lost. After doing some research, I can attribute the loss of my folder to the way ext4 writes a file. I also found some solutions on how to recover my folder but I decided to do it again from scratch since recovering it will entail more work than actually rewriting the code. Here’s a more detailed explanation on what might have happened to me.

To catch up, I had to do some sort of coding marathon. I was awake for some 57 hours minus some short naps. During that time, I learned a lot from my co-developer.

It was a very fun experience and I am looking forward to working on more projects in the future.

And up to now, I am still looking forward for a beach outing. XD

Posted in Programming


Jan
18
2010

Searchable UPCAT 2010 Results, Student Number Database, etc

UPCAT 2010 Results (University of the Philippines College Admission Test) were released earlier today, January 18, 2010 both online and offline.

The new official results page is now non-searchable, I wonder why. But that’s not a problem because I made a searchable version of the one’s in the UP website.

I also made a super lightweight web app that checks if your 2010 counterpart passed UPCAT or not. In my case, 201041437 either didn’t pass, still has deficiences or a pending case. His or her name was not on the list. :(

Aside from this, I also made another one last night which is not related to UPCAT. It’s a searchable database of UP student numbers. I got those student numbers from various sources from the Internet, including past UPCAT results. Hahaha.

I really missed scripting. :( All those stuff above are hosted on my laptop therefore they’ll be down whenever my laptop is sleeping. LOL.

Tags: ,  
Posted in Programming, Random


Dec
23
2008

A Geek Day with PHP, Magpie RSS, Cron, mail function and Everything Niice

DISCLAIMER: For those who are not interested in PHP, you better not bore yourself with this post.

It was ages ago since I made posted some really geek stuff. I think I had to live up with my blog title, Build that Geek — and so I had to rebuild the geek inside me.

bot

Overview

An hour ago, a brilliant idea was distracting my sleepy brain (it was around 4am). The idea was shining so much that my eyes were blinded by it (my pair of eye was facing the inside of my head). At first, I was hesitant to do it by I eventually gave in.

The idea was to create a PHP program that would notify me thru SMS and email every time a PRC Board Exam result is released. The program would ran every five minutes by means of creating a cron job that would execute it.

The program flow are as follows:

  • START
  • The program, thru the PHP server would contact an external source requesting information.
  • The external source would feed the requested information back to the PHP server.
  • The program would parse the data in a PHP-readable format.
  • The parsed data will be filtered (non-PRC related stuff would be dropped).
  • CONDITIONAL: Was the parsed data previously been sent:
    • if yes: END.
    • if no, continue.
  • The program will notify me regarding the PRC Board Exam result release thru SMS [thru an SMS Gateway] and email [thru PHP's mail function]
  • END

The Search for Source of Information

gmanewstvlogo

I strolled around the Internet. The most reliable source I could have is the PRC Official Website. I visited the website and tried to search for an RSS or a well-organized XML file. Too bad there weren’t any. I thought of extacting information from the website the dirty way (using eregi, str_replace, and other string manipulation functions) but it was too much for my tired brain.

The next one was Philippine Daily Inquirer’s inquirer.net. I immediately searsuched their site and poof, there’s this XML feed. I thought it was all fine but when I checked it, it was pretty outdated. If I’d use it, the program would defeat the purpose of informing me really fast of the latest news.

Next was ABS-CBN News. In their Public Service area, they served PRC Board Exam result news. They supplied an RSS feed, but sadly it was blank. It contained no information.

The last one who successfully won me was GMANews.tv. I checked their site and they were also serving PRC Board Exam result news. I learned that they publish it on-the-go on their Nation section. Their top stories section had a usable RSS feed, woot. Finally, I’ve got it.

Data Parsing and Extraction

The next thing to do was to extract the data. How could I parse the RSS feed in such a way PHP would understand it well. Since Google is my friend, I tried googling my problem. Google (search engine) introduced to me Magpie RSS, the program I was looking. Just feed an RSS feed to Magpie RSS and it would break the individual feed items into arrays.

Implementation of Magpie RSS to the program was easy since they have posted a simple how-to on their website.

Filtering the Data

0002_thebigloser_billjunk

Since it was a Nation section feed, not all items on the feed were regarding PRC. There was a need to filter it out. The easiest way that came into my mind was to match either one of the following string “prc” or “professional” to the feed descriptions. If the feed description contained the said strings in a non-case-sensitive way, then retain the information; else drop them. What I used in this part was the eregi function.

Notification and all sorts of stuff

The next thing to worry about was on how to notify me. I also realized that previously sent news did not need to be sent from time to time. For this, I made a MySQL database that would save previously sent information. If the information about to be sent is not on the database, then send it; otherwise, don’t.

The email notification was easy. Gladly, PHP has this easy-to-use mail function. For the SMS notification, I used a free SMS gateway.

Keep it running, indefinitely

Since the program needs to run from time to time, I made a cron entry that would command the server to run it from time-to-time.

Conclusion

The idea was possible. Barely 30 minutes were spent doing it. Source code may be requested by contacting me thru my contact page (accessible in the header and footer).

Tags: ,  
Posted in Programming


Sep
17
2008

[On Balancing Academics, House Council and Slack Culture] and [Rants]

These past few days, I’m having a hard time balancing my academics, house council work and the slack culture I’ve been used for so many years.

I’ve been guilty for not performing well on my academics. I’ve been guilty for not being so active in doing house council works. But I’m extremely guilty for slacking all day and night in front of my laptop playing with PHP Frameworks (CakePHP and CodeIgniter).

As the end of the semester is fast approaching, I promise myself to perform well on all three fields. I’ll try not to miss a single class, not to miss another house council deadline, at the same time not to deprive myself on entering my sweet slack culture.

Good luck to me. I still have to study well for my upcoming Math17 4th Long Exam this Friday. I still have to finish all my Machine Exercises due this Monday (it was supposed to be by groups of three but since I missed the special Monday class, I have to do it alone). I still have to reply to inbound nonrhetorical House Council letters. I still have to finish collecting data for the Kalayaan Residence Hall Association resident database. I still have to reduce my slack time that it yields an equilibrium when I sum those three fields up.

*******

I got a sure 5.0 for Physical Education 2 (Scuba Diving) for a reason that I was not able to find my class. I went to the venue of my class as stated on my Form 5, time of my class but did not find them there. I chose to enter another class on the same venue (Pool 1) – Skin Diving, for fun. I was not able to “Change Matriculation” from Scuba Diving to Skin Diving for a reason that I can’t find my instructor. I was not able to drop my subject ’cause as I’ve said I can’t find my instructor.

But it’s okay. PE units are not included on General Weighted Average (GWA) computation. At least, I’ve enjoyed swimming on the pool without the snorkels unlike my other classmates. I was able to survive in the middle of a 12-foot pool, again without the snorkels. I was able to enhance my swimming skills. I was able to increase the possibilities of me getting admitted to the Swimming Varsity.

*******

Partner Residents – our buddies from our partner corridors (in the dorm). I had three partner residents, but only know two of them. Since we’re required to have a documentation of a “date” with the partner residents, we dated. We had our dinner last night at the Treehouse (a restaurant near SOLAIR and University Avenue). Since I’m the guy of the trio (supposed to be quatrio [not sure on this], it was my treat. We shared a fraction of our lives to each other. Badly, we had to go early since I still have to attend to a House Council meeting.

*******

Computer Center (UP Computer Center) serves as the central hub that interconnects the fiber-optic backbones in UP Diliman and other UP campuses (Wikipedia). For four months, I’ve been having a good time accessing the Internet thru the facility’s wireless internet. It was fast, as fast as downloading a 700mb file in 40 minutes. How fast is that? One SpeedTest.net evaluation gave me a download speed of as high as 9,000+ kilobits per second [equivalent to 1.xx MB per second download] on a nearby testing station and as low as 1500 kilobits per second [200+ kb per second download]. Cool! But just recently, the internet users there are stuck with a slower and unstable Internet. What do I mean by slow? Only about 700+ kbps on most servers.

I know that 700+ kbps is a pretty fast home internet but being used to lightspeed Internet, it’s crappy slow. Huhuhu, I hope that it gets fixed as soon as possible.

–end–

Posted in Personal


Mar
22
2008

PHP Function for Checking Google Pagerank

Hey guys, I found this nifty piece of PHP file. It contains a PHP function for checking Google Pagerank. I had a hard time finding for a good code. I saw some working codes but too bad they were PHP classes which I’m not very familiar with.

The PHP file’s homepage can be found here.

Anyway, please don’t abuse the use of this Google Pagerank check PHP function. It has been reported that Google bans I.P. addresses of abusive servers.

Have fun with the code! :D

Tags:  
Posted in Google, Programming


Mar
22
2008

Blog Readership Index Project

Graphs, graphs and graphs.

Isn’t it lovely to see the Philippine Stock Exchange Index rise and fall? How about making one for blogs? Let me call it the Blog Readership Index.

Yes, again I’m starting a new project. I’ve coded the backend’s core, frontend’s not finished.

Overview/Specifications

Blog Readership Index aims to be a good measure of blog readership. It also aims to track growth or decline in blog readership levels.

Here’s the project’s homepage.

Tags: