Brandon Kang

Checking Mobile/RWD applied web sites using Node.js

Blog Post created by Brandon Kang Employee on Jan 25, 2016

One day,

A marketer asked me how she can check if a certain web site has RWD(Responsive Web Design) functionalities or not.

I shared https://www.google.com/webmasters/tools/mobile-friendly/ and Do You Use Responsive Web Design | Responsive Design Checker for that.

 

But the problem is that she had a domain list which included over 20K web sites!

As the previous two services are only providing outs after a web site domain name is input, the services were useless.

I thought that we need an automatic way to get a satisfied test result that's why I coded  https://github.com/BrandonKang/CDN-Tools/blob/master/rwdcheck.js

 

The algorithm in it is very simple.

The general Mobile/RWD applied web sites has below properties.

 

1) They redirects to m dot site. ex) www.example.com redirects to m.example.com

2) They redirects to /m/ paths which means mobile transformed pages  ex) www.example.com redirects to www.example.com/m/

3) After applying genuine RWD, they don't redirect but they have some domain and path. instead, some magics in HTML source codes are found

- It has @media queries or,

- it has row-fluid functions or,

- it has viewport tags, or

- etc.


After thinking of 1), 2), and 3), I coded RWD checker with Node.js. (to be honest, it is not 100% perfect as the other algorithms should be inserted someday..)

You can see above algorithms are applied after you look at the codes in CDN-Tools/rwdcheck.js at master · BrandonKang/CDN-Tools · GitHub

 

It need a domain.txt file which has web site domains list in row.

domain.txt example.

Screen Shot 2016-01-25 at 5.59.18 PM.png

Then, the outputs in console screen will be like this. It has comma(,) separator to make cvs file style.

Screen Shot 2016-01-25 at 6.04.30 PM.png

You can easily import a cvs file and export it to the xlsx file to make a report

Screen Shot 2016-01-25 at 6.08.55 PM.png

Hope this tool is helpful to someone.

Thanks.

Outcomes