Tag: Mobile

  • Trouble comparing dates in PHP

    The scenario.
    I’m building a custom tool which automates the curation of blogs from member bloggers’ feeds. These blogs must be fetched on a weekly basis because the intention is to make sure every member blogger, blogs at least once a week.
    Where to the feed URLs come from?
    Member joins by submitting a blog feed URL, which will save in the system manually at the moment.
    The system(bot) must;

    1. Retrieve the feed URLs from the database.
    2. The system should loop the URLS.
    3. Connect to each URL.
    4. Fetch one feed item(latest).
    5. Get the feed item date and compare it to the date of last Sunday. If the feed date is greater than the date of last Sunday.
    6. Connect to the database again and retrieve a blog item whose item title is similar to the feed item title. If a blog item similar to the feed item is returned, skip that feed item since we already have it and move to the next. Repeating steps 2 to 6.
    7. If the blog item similar to the feed item is not returned, insert it in our blog database to store it permanently.

    Tools used.
    First of all, I chose PHP programming language to accomplish the task. I would have chosen Python, however, my hosting environment doesn’t have python. Yet am also more experienced in PHP than Python.
    I also hard to extend WordPress so that I don’t have to build everything from scratch. Using WordPress will give me the opportunity to automate member sign up, log in and feed submission easier than if I used something different.
    I will eventually build a frontend interface for the system. This interface will enable the public readers to choose and read any blog of their choice as well as enable bloggers to sign up from any part of the world. Building a WordPress theme will be much easier than if I built everything from scratch.
    Alternative tools one could look at Joomla, Drupal and Django and many others.
    What have I built so far?
    So far I have built a WordPress plugin, with the following features.

    1. Automated Feed fetcher
    2. Shortcode which lists active bloggers. This is helpful for displaying member bloggers on the homepage or any page. Hence make it easy for readers to navigate blogs of any member(author)
    3. Shortcode for listing blogs. The intention of the system is to curate blogs from consistent bloggers around the world and make them accessible by consistent readers. This shortcode helps in displaying the blogs on the platform.

    Challenges

    1. Comparing dates.

    PHP has several inbuilt date functions and objects such as DataTime(), CreateDate() etc but they were not helpful. Sometimes they could function but they were never consistent. Luckily enough converting the date strings to time saved me after many trials and struggle.

    Solution

    $TimelastSunday = strtotime(‘last Sunday’);

    $TimeFeedItem = strtotime($feedItem->get_date(‘m-j-Y’));

    if($TimeFeedItem > $TimeLastSunday) {

    // Do the rest

    }

    Whoa! Whoa!
    Can’t wait to enable automated signing up, blog submission and attachment of categories and tags to the fetched/retrieved feeds.
    Thanks for reading until next time.

  • Learn the modern way of developing Web applications this festive season for free.

    Learn the modern way of developing Web applications this festive season for free.

    If there is anything I’m passionate about nothing beats the passion to use technology to benefit fellow humans.
    Since I got the opportunity to live in the generation where the world is a global community because of internet, it gifts me the privilege to learn and share. This festival season, I would like teach you about developing functional web applications using modern tools and approaches.
    Take a look at the table of contents.

    1. Prerequisite
    2. Web design vs Web applications development
    3. Extending is smart!
    4. Components of a Web application.
    5. Powering web applications with WordPress
    6. The do list application

    At the end of the tutorial I expect the reader to:-

    • To differentiate web design from web development.
    • To learn the different components together with their functionality in web applications.
    • To develop web applications using WordPress as an underlying framework.

    Stay tuned for the next post, in which I will reveal my experiences and the requirements you need to benefit from this short but practical tutorial.
     
     
     

  • Ordering for a new logo? Here are some tips for you.

    A logo is a sensitive symbol of our causes and businesses/organisations. Most of the time they communicate our character in the market, so they are subjective.
    In this article, I would like to share one important consideration for anyone planing to make a logo by themselves or order one from professional graphics designers. The critical part of the logo today is ease of use on numerous devices and technologies.
    Some years ago that flexibility wasn’t much of a requirement because logos could be mostly shipped on print media.
    Technology growth is quickly changing that. In that a logo should now be produced in various versions characterized by dimension and color.
    Therefore a new logo or even a old but revised one should at least have three basic versions:- the standard version, alternative version and mobile version.
    The standard version
    This version is what you are likely to get if you design a logo for yourself or even from a professional designer who doesn’t care much about the other versions.
    Pros
    It is in full color.
    It is big enough(dimension) which makes it good for any print.
    Cons
    It may not work well on small devices like mobile phones, tablets and websites.
    The alternative version
    As much as it’s important, this version is usually ignored by many logo owners. It is also called the negative or grey scale logo.
    Pros
    It comes at a dimension of the standard logo though in monochrome.
    Being monochrome it can be used in most of the partners’ media especially the mobile, web applications and websites.
    Cons
    Since it’s monochrome, it can’t be used anywhere if your logo originally comes in more than one color.
    Mobile version
    The mobile version is a small logo in terms of dimension(width and height) made in both full color and monochrome. It is an important logo for mobile applications and websites. If the standard logo is complex i.e has many symbols which may not be visible shrink mode, effort should be taken to remove some of those symbols in this version.
    Pros
    It will fit and represent the brand on the widely used devices today.
    It is good to be used as an icon, for a mobile application and website fav icon.
    Cons
    It is not good for print media.
    Bonus: It is good discipline to always have the original editable versions of the logo and any graphic for your brand. Without them flexibility is not paramount as you stand a high chance of color and dimension inconsistency in the future publications.
     

Verified by MonsterInsights