stoimen.com/blog

web developing

Internet Mobile

It isn’t strange that the internet is becoming more and more mobile. When it matters to news sites I think most of the mobile versions are better than the “desktop” versions of the site. Take a look at Huffingtonpost.com or LeMonde.fr.

Mobile Ads

The first thing that makes impression when comparing both mobile and desktop versions of a site is the layout. Of course the lack of ads on the mobile version, or if not the absolute lack at least the small number of appearing ads, seems to be quite pleasant.

The thing is that as the web grow and as the web 2.0 is becoming a reality most of us will prefer to use it on a mobile device, just because it’s

  1. easier to use
  2. easier to find
  3. easier to follow

Here’s a nice example of what mobile phones are now.

Now lets take a look on how the mobile web will grow in the near future.

That graphics describe quite well what will happen in the upcoming years. Is there now a question: should I make a mobile version of my site?

  • 1 Comment
  • Filed under: web development
  • PPK is right! Stop developing everything as a iPhone app. First that doesn’t work on any device except iPhone and it’s difficult to maintain. In reverse you should begin doing your mobile web site version. Hopefully with HTML5.

    Do as Twitter did … or you’d be looking at http://m.digg.com – that’s the right way.

  • 1 Comment
  • Filed under: web development
  • cssText

    You know you can manage to redraw an element with single browser reflow. Instead of using .style.property … you can simply add all CSS properties you’d like to change with simply appending to style.cssText property.

    var csstxt = $('#selector').css('cssText') + ';top:100;left:100;border:1px solid red;color:#f00;';
    $('#selector').css('cssText', csstxt);

    That code is a replacement for

    $('#selector').css({
       left : '100px',
       top : '100px',
       border : '1px solid red',
       color : '#f00'
    });

    enjoy!

    JavaScript Zen

    Is undefined equal to undefined?

    That’s the question! Crockford says it is not, but let see the experiment.

    var a, b;
    console.log(typeof a);
    console.log(a === b);

    the answer is – it is.

    Zend_Gdata

    Zend Framework gives you the possibility to interact with Gdata services, which are provided by most of the Goolge services. You can find more on the docs page of Zend_Gdata. The basic principle is that you can connect a service with you API key, given by Google. What I’m about to show you is how do connect such a service.

    In theory Zend_Gdata depends on Zend_Http_Client and you’ve to connect it with an instance of this class.

    // 1. setup API key
    $apiKey = 'your_api_key_here';
     
    // 2. retrieve videos via GData Atom
    $client = new Zend_Http_Client();
    $gdata = new Zend_Gdata_YouTube(null, 'my-app', null, $apiKey);

    Note that you’ve to replace your API key in the chunk above.

    Now once that you’ve connected the YouTube service you can iterate through the entries from the video feed.

    $videoFeed = $gdata->getUserUploads('username');
    foreach ($videoFeed as $entry) {
        echo $entry->getTitle();
    }

    The thing is that you can modify a bit the code above. As ZF docs says if you don’t setup a Zend_Http_Client a default with default configuration, so you can omit this and simple write:

    // 1. setup API key
    $apiKey = 'your_api_key_here';
     
    // 2. retrieve videos via GData Atom
    $gdata = new Zend_Gdata_YouTube(null, 'my-app', null, $apiKey);