NSA: Please Turn off the Lights When You Leave. Nothing to See Here.

Linux Advocate Dietrich Schmitz shows how the general public can take action to truly protect their privacy using GnuPG with Evolution email. Read the details.

Mailvelope for Chrome: PGP Encrypted Email Made Easy

Linux Advocate Dietrich Schmitz officially endorses what he deems is a truly secure, easy to use PGP email encryption program. Read the details.

Step off Microsoft's License Treadmill to FOSS Linux

Linux Advocate Dietrich Schmitz reminds CIOs that XP Desktops destined for MS end of life support can be reprovisioned with FOSS Linux to run like brand new. Read how.

Bitcoin is NOT Money -- it's a Commodity

Linux Advocate shares news that the U.S. Treasury will treat Bitcoin as a Commodity 'Investment'. Read the details.

Google Drive Gets a Failing Grade on Privacy Protection

Linux Advocate Dietrich Schmitz puts out a public service privacy warning. Google Drive gets a failing grade on protecting your privacy.

Email: A Fundamentally Broken System

Email needs an overhaul. Privacy must be integrated.

Opinion

Cookie Cutter Distros Don't Cut It

Opinion

The 'Linux Inside' Stigma - It's real and it's a problem.

U.S. Patent and Trademark Office Turn a Deaf Ear

Linux Advocate Dietrich Schmitz reminds readers of a long ago failed petition by Mathematician Prof. Donald Knuth for stopping issuance of Software Patents.

Showing posts with label WordPress. Show all posts
Showing posts with label WordPress. Show all posts

Saturday, March 23, 2013

JSON: The Undisputed King of Web Interchange APIs

by +Dietrich Schmitz

I have been roaming over the InterTubes in search of various technical information as regards this website.

It can at times be like looking for a 'needle in a haystack' when it comes to pinning down a specific method of getting your website to function in a specific way.

Like for instance, it occurred to me that there ought to be a 'standard way' to query (via some application programming interface or API call) a chunk of information concerning activity taken on the website, be it global website metadata, something about a post or collection of posts or about a specific author--stuff like that. (Credit image right: www.json.org)

Well, the bad news is, there really isn't one 'standard' way.  The good news is, today at least, you have more than one way to obtain that information at your disposal.  But that can create confusion.

In fact, if you do the requisite research as I have (in an effort to answer a few needs here on Linux Advocates), you might at first be overwhelmed by the sheer surplus of data, help websites, how-to's, 'know-it-all' posts that confront you, all bombarding your brain on a Google search adventure.

Fortunately, in the case of Blogger, the documentation for their web application programming interface is right at your fingertips here.

The methods you ultimately choose for reaching into your website's data cache will depend on which web engine you have chosen and which tools you employ.

So began my journey into the wonderful world of Javascript Object Notation, otherwise known as JSON.

For many website platforms, it might seem most direct to simply write a SQL to obtain the data needed on the backend database, used to store persistent data.  And on many websites, that is frequently done.

As for Blogger, the web monkey (Me) doesn't have access to a database per se.  The database, if there is one, isn't surfaced by Google.  Instead, what they expose is the aforementioned API, JSON.  A seemingly circuitous path, set of gymnastics a code monkey must contort into to get at the needed data.

Some things come more easily for dedicated programmers than the less initiated.  For starters, having a higher threshold of 'pain' works to one's advantage--when I can't find an answer, I obsess for days, gnash teeth, fidget, until I hit on the answer--pretty routine masochistic self-imposed torture.  Most programmers accept this as part of their occupation and resign themselves to pouring over on-line technical documentation, some better and some less so, all in a vengeful determined effort to divine the 'magic' to getting from point A (the problem) to point B (the solution)--returning the correct piece of data or desired function (behavior), hopefully.

So, after many starts and stops, interruptions, staring for long periods of time, ranging across the Internet (one time there was a sign 'You have reached the end of the Internet--turn around and go back'), I was finally feeling like I had decoded the 'Rosetta Stone' and came up with a subset of code which might be your 'prototypical' example for querying the JSON API:










Good Code Monkey.  Now press the button and take the pellet.  There.

Pretty much the above JSON code lives neatly inside of Javascript and co-exists nicely all wrapped up in a tidy HTML page.  One can also use just about any programming language under the Sun--there's most likely a library which encapsulates JSON for your preferred programming tool, be it PHP, Perl, Python, what have you.

Along the way, in my various readings, I came across this sterling article which summarizes quite well why JSON is revolutionizing the 'Internet of Things'.  The author Luc Perkins keenly observes:

"...Ten years ago, XML was the primary data interchange format. When it came on the scene, it was a breath of fresh air and a vast improvement over the truly appalling SGML (Standard Generalized Markup Language). It enabled people to do previously unthinkable things, like exchange Microsoft Office documents across HTTP connections. With all the dissatisfaction surrounding XML, it’s easy to forget just how crucial it was in the evolution of the web in its capacity as a “Swiss Army Knife of the internet.”

But it’s no secret that in the last few years, a bold transformation has been afoot in the world of data interchange. The more lightweight, bandwidth-non-intensive JSON (JavaScript Object Notation) has emerged not just as an alternative to XML, but rather as a potential full-blown successor. A variety of historical forces are now converging and conspiring to render XML less and less relevant and to crown JSON as the privileged data format of the global digital architecture of the future. I think that the only question is how near that future is.

I strongly believe that this transformation can be attributed to four broad trends, which I’ll discuss in turn:

1. APIs (application programming interfaces)
2. Big Data
3. The Internet of Things
4. Full-stack JavaScript..."

So, during my journey learning JSON, I have reached the conclusion that in today's 'mash-up' Web 2.0 world where one website incorporates chunks of data from another unbeknownst to the average user, behind the scenes is most likely JSON at work.

Ten years ago, XML might have been the only solution for serializing and exchanging data over http.
Even more sophisticated today is using JSON over Websockets which is only beginning to turn up in some of the more advanced website coding practices.

JSON's lightweight nature requires far less effort than XML and integrates into most website frameworks now as a plugin architecture if not present in its default installation.


So, does this fit with your view on the 'Internet of Things' and experience with the newest programming paradigms?  Please give your feedback!

-- Dietrich


END
Enhanced by Zemanta

Tuesday, March 12, 2013

Google Blogger Exceeds My Expectations

By +Dietrich Schmitz

I have used many Website blogging tools, including WordPress, Movable Type, Plone, etc.  With each tool, I learned to hack html/css reasonably well and found that no two tools approach managing content in the same way.  Content Management Systems (CMS) tend to be more comprehensive offering ways to create workflows, new datatypes, allowing users to host their own sites, with integrated forums and scalability.  Of the aforementioned tools, I'd say Plone and Movable Type are the only tools I have used which are true CMS.

I won't dwell on the CMS issue other than to say too many vendors are labeling their product as CMS when it really is not as such.

WordPress has probably the largest following and a significantly large ecosystem built up around it including a wide variety of theme templates, plugins, third-party template Designers and support forums for getting help in any situation that might arise.

WordPress is followed closely by a new legion of MVC tools nipping at their heels for a slice of the market, including the likes of Joomla, Drupal, Django, Mojolicious,  and Catalyst, to name only a few.

All have a 'learning curve' which varies--some easier, some less than easy.

That being the case, I went ahead with my plan to start Linux Advocates with +Katherine Noyes in January 2013.  I wasn't particularly concerned as I went through the various tools considering which to use as I knew full well I would be able to handle whatever challenges I encountered.  I've spent years torturing myself in one way or another with all manner of programming tools, I thought--what's the difference?

So, how did I come up with Blogger?  Some might react and say that Blogger has limitations.
I think that might have held true a few years ago when Google first acquired Blogger from Pyra Labs in 2003.

I did a lot of reading on line and of course had a Google Blogger account which I had 'fiddled' with not too seriously several years ago and had put aside.  And I quickly discovered a lot has changed since my last encounter with Blogger.

It turns out that Blogger has done a lot of growing up since 2003 and is quite robust, including many default features not present in other perhaps more popular blogging tools.

I chose Blogger, not the least of which because it relieved me of some of the many 'headaches' and maintenance issues which come with co-location service based blogs, most of which are big time consumers in the setup and configuration phase of designing a website.

For one, there's no ftp service and no special apps to configure as might be found in the typical LAMP stack.  You are isolated from any part of the website operating system--all tasks being done through the Admin console.  Unlike Blogger for example on my self-hosted Plone site for www.dtschmitz.com, I had to tediously configure an Apache reverse-proxy, a Plone server, and a Zope Server as all interact to present the Plone CMS site.

With Blogger, there's no load balancing or clustering needed to scale.  Blogger is running on the back-end on Google Apps Engine Folks and includes its own sophisticated template language and JSON/AJAX API.

Templates are freely available from Google and third-party Developers.  The templates support the newest web standards including HTML5, CSS3, and AJAX and support a 'Widget' plugin architecture unique to Blogger.  Blogger has a thorough on-line help system for both end-users and Developers that will answer most questions, but if you don't find your answer there, you'll soon discover that the answer is a few Google searches away as most likely someone else has encountered your issue and will have the answer.

The Blogger has undergone many revisions since 2003 reaching the most recent feature set in 2012.  Each iteration brought new features and a redesign of the administrative authoring interface.

Starting with selection of your template, Blogger will hold your hand in the selection and deployment and does a good job of guiding you to what needs to be done with a very nice Drag & Drop Design Layout system, that enables even a novice to quickly add gadgets and plugins, tweak css settings such as font, color, in the header, body and footer areas, add favicons, banner images, etc.  The layout is easy to learn, and designed well with little clutter to confuse the user.

Blogger integrates well with other Google tools, and on the backend all image files are archived for free in Picasa.

Integrated also into Blogger is Google's Adsense and Web Analytics with a really nice 'Stats' page giving all manner of metrics regarding how your site is doing including cross tabulation of Pageviews by Author, Post, Operating System, Browser, and Country.  One can go to the Overview page and quickly see the day's activity at a glance to see how things are going or to see trending stories and the largest referrers to your website.

Blogger Admin Console Stats Section


The Design Layout by default includes embedded Adsense so unless you need to move the ads around, the placement is generally good in its default configuration.

I had little to do in terms of changing the Template in January.  There were some SEO optimizations and jQuery plugins which I embedded in the site for added features and special effects.  I tend to be conservative in that regard and find too many sites saturate the visitor with clever jquery widgets that simply do nothing but get in the way of the user to the point of annoyance.  Bearing this in mind, I took a minimalist approach to making any jQuery additions with the objective of only adding a feature if it provided added eye appeal or additional usability.

To my surprise, Blogger's approach to templating is to include the CSS and HTML together in one file using clever header VARiable declarations for various attributes in the template CSS schema followed by a skin section where the CSS is fleshed out passing in the VAR CSS elements as a $CSS.selector identifier usually named the same as the CSS selector for consistency.

It's easy to read and following the skin section comes the <html> <head>, <body>, </html> sections.
All is well organized and predictable.  In fact, porting popular templates from other vendors such as WordPress is common-place and easily accomplished in Blogger.

In addition to the default threaded and moderated comment system, DISQUS offers their own comment SaaS interface, which I chose to use with Linux Advocates. It integrates seamlessly with Blogger, provides support for spam blocking, multiple moderators, and multiple nested comments, single-signon, just to name a few features.  It's a better more flexible commenting system than the default Blogger system but even the Blogger system is quite doable for those who care not to make a replacement.

The posting editor does a reasonably good job with drag-drop ability and most of the typical toolbar formatting options.  Blogger supports third party SEO optimization tools--one of which is Zemanta, and I use the Zemanta plugin for Chrome.  A plugin is also available for Firefox.

The result is that the Blogger ecosystem has grown to such an extent that is now quite mature and does a really good job at standing up against the competition on a feature-by-feature basis.  It is quite respectable and I am now in my second iteration of template replacement which I upgraded this past weekend.

All in all, I must take my hat off to the Google Blogger Developers.  Blogger has exceeded all of my expectations.

So, whether you are a newcomer to expert or are thinking of switching from your current tool set, you owe it to yourself to evaluate Blogger before you make a choice.

I highly recommend Blogger.  -- Dietrich
Enhanced by Zemanta