How to get list of countries using firebug, jQuerify and Firefox

While working on a project I wanted a list of all possible countries for my web application. Of course I wanted to put it into database. The query was as shown below:

INSERT INTO Country VALUES(‘CountryName’,1,NOW(),1,NOW());

I found countries from Yahoo directories from this link.

Now imagine how long it would have taken If I would have copied each country name from that page to write insert queries. Instead I used firebug console. Once you open firebug console click on jQuerify (you have to install this add-on separately.)

In firebug console I typed following command

$('ul li a b').each(function(){
document.write("INSERT INTO Country VALUES('" + $(this).text() + "',1,NOW(),1,NOW());<br>");

And it generated following output

INSERT INTO Country VALUES(‘Afghanistan’,1,NOW(),1,NOW());
INSERT INTO Country VALUES(‘Albania’,1,NOW(),1,NOW());
INSERT INTO Country VALUES(‘Algeria’,1,NOW(),1,NOW());
INSERT INTO Country VALUES(‘Andorra’,1,NOW(),1,NOW());
INSERT INTO Country VALUES(‘Angola’,1,NOW(),1,NOW());
INSERT INTO Country VALUES(‘Antigua and Barbuda’,1,NOW(),1,NOW());
INSERT INTO Country VALUES(‘Argentina’,1,NOW(),1,NOW());

So to end, someone said, "Work Smarter, Not Harder…!!!"

Here you can see the video demo.


Jackie Co Kad said…
Great Article
android based projects

Java Training in Chennai

Project Center in Chennai

Java Training in Chennai

projects for cse

The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing,

and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai

Android Final Year Project Ideas for Computer Science. IEEE Android Projects for CSE 2020 - 2021 - WISEN

Popular posts from this blog

How to get local time from UTC using Moment.JS

Step by step Cordova calabash-ios automation

Measure the height of keyboard on PhoneGap app using jQuery