Skip to content

Instantly share code, notes, and snippets.

@tarunbhardwaj
Created July 4, 2013 11:55
Show Gist options
  • Save tarunbhardwaj/5927068 to your computer and use it in GitHub Desktop.
Save tarunbhardwaj/5927068 to your computer and use it in GitHub Desktop.
JS Bot to load all partners of OpenERP
/*
Run on https://www.openerp.com/partners/directory/
*/
var countries = Array();
$(".oe_countries ul li a").each(function(){
if ($(this).attr("href") != undefined)
countries.push({
"Link": $(this).attr("href"),
"Name": $(this).html(),
"Partners": 0,
});
});
var total_count = 0;
function fetch(index){
var obj = countries[index];
console.log("fetching for " + obj.Name + " from " + obj.Link);
var ajx = $.get(obj.Link).done(
function(data){
html = $.parseHTML(data);
obj.Partners = $(html).find(".oe_content").length;
console.log("Partners for "+ obj.Name + " are " + obj.Partners);
total_count += obj.Partners;
}
);
}
for (var i=0; i<countries.length;i++){
fetch(i);
}
@tarunbhardwaj
Copy link
Author

Total 464 Partners in 98 Countries

Output

fetching for Afghanistan from https://www.openerp.com/partners/directory/AF/Afghanistan
fetching for Albania from https://www.openerp.com/partners/directory/AL/Albania
fetching for Algeria from https://www.openerp.com/partners/directory/DZ/Algeria
fetching for Angola from https://www.openerp.com/partners/directory/AO/Angola
fetching for Argentina from https://www.openerp.com/partners/directory/AR/Argentina
fetching for Australia from https://www.openerp.com/partners/directory/AU/Australia
fetching for Austria from https://www.openerp.com/partners/directory/AT/Austria
fetching for Bangladesh from https://www.openerp.com/partners/directory/BD/Bangladesh
fetching for Belgium from https://www.openerp.com/partners/directory/BE/Belgium
fetching for Benin from https://www.openerp.com/partners/directory/BJ/Benin
fetching for Bolivia from https://www.openerp.com/partners/directory/BO/Bolivia
fetching for Brazil from https://www.openerp.com/partners/directory/BR/Brazil
fetching for Bulgaria from https://www.openerp.com/partners/directory/BG/Bulgaria
fetching for Cambodia from https://www.openerp.com/partners/directory/KH/Cambodia
fetching for Cameroon from https://www.openerp.com/partners/directory/CM/Cameroon
fetching for Canada from https://www.openerp.com/partners/directory/CA/Canada
fetching for Cape Verde from https://www.openerp.com/partners/directory/CV/Cape+Verde
fetching for Chile from https://www.openerp.com/partners/directory/CL/Chile
fetching for China from https://www.openerp.com/partners/directory/CN/China
fetching for Colombia from https://www.openerp.com/partners/directory/CO/Colombia
fetching for Congo from https://www.openerp.com/partners/directory/CG/Congo
fetching for Costa Rica from https://www.openerp.com/partners/directory/CR/Costa+Rica
fetching for Croatia from https://www.openerp.com/partners/directory/HR/Croatia
fetching for Côte d'Ivoire from https://www.openerp.com/partners/directory/CI/C%C3%B4te+d%27Ivoire
fetching for Denmark from https://www.openerp.com/partners/directory/DK/Denmark
fetching for Dominican Republic from https://www.openerp.com/partners/directory/DO/Dominican+Republic
fetching for Ecuador from https://www.openerp.com/partners/directory/EC/Ecuador
fetching for Egypt from https://www.openerp.com/partners/directory/EG/Egypt
fetching for Estonia from https://www.openerp.com/partners/directory/EE/Estonia
fetching for Ethiopia from https://www.openerp.com/partners/directory/ET/Ethiopia
fetching for Finland from https://www.openerp.com/partners/directory/FI/Finland
fetching for France from https://www.openerp.com/partners/directory/FR/France
fetching for Germany from https://www.openerp.com/partners/directory/DE/Germany
fetching for Ghana from https://www.openerp.com/partners/directory/GH/Ghana
fetching for Greece from https://www.openerp.com/partners/directory/GR/Greece
fetching for Guadeloupe from https://www.openerp.com/partners/directory/GP/Guadeloupe
fetching for Guatemala from https://www.openerp.com/partners/directory/GT/Guatemala
fetching for Honduras from https://www.openerp.com/partners/directory/HN/Honduras
fetching for Hong Kong from https://www.openerp.com/partners/directory/HK/Hong+Kong
fetching for Hungary from https://www.openerp.com/partners/directory/HU/Hungary
fetching for Iceland from https://www.openerp.com/partners/directory/IS/Iceland
fetching for India from https://www.openerp.com/partners/directory/IN/India
fetching for Indonesia from https://www.openerp.com/partners/directory/ID/Indonesia
fetching for Iran from https://www.openerp.com/partners/directory/IR/Iran
fetching for Ireland from https://www.openerp.com/partners/directory/IE/Ireland
fetching for Italy from https://www.openerp.com/partners/directory/IT/Italy
fetching for Japan from https://www.openerp.com/partners/directory/JP/Japan
fetching for Kuwait from https://www.openerp.com/partners/directory/KW/Kuwait
fetching for Laos from https://www.openerp.com/partners/directory/LA/Laos
fetching for Lebanon from https://www.openerp.com/partners/directory/LB/Lebanon
fetching for Libya from https://www.openerp.com/partners/directory/LY/Libya
fetching for Lithuania from https://www.openerp.com/partners/directory/LT/Lithuania
fetching for Luxembourg from https://www.openerp.com/partners/directory/LU/Luxembourg
fetching for Macedonia from https://www.openerp.com/partners/directory/MK/Macedonia
fetching for Malaysia from https://www.openerp.com/partners/directory/MY/Malaysia
fetching for Mauritius from https://www.openerp.com/partners/directory/MU/Mauritius
fetching for Mayotte from https://www.openerp.com/partners/directory/YT/Mayotte
fetching for Mexico from https://www.openerp.com/partners/directory/MX/Mexico
fetching for Morocco from https://www.openerp.com/partners/directory/MA/Morocco
fetching for Myanmar from https://www.openerp.com/partners/directory/MM/Myanmar
fetching for Nepal from https://www.openerp.com/partners/directory/NP/Nepal
fetching for Netherlands from https://www.openerp.com/partners/directory/NL/Netherlands
fetching for New Caledonia from https://www.openerp.com/partners/directory/NC/New+Caledonia
fetching for New Zealand from https://www.openerp.com/partners/directory/NZ/New+Zealand
fetching for Nigeria from https://www.openerp.com/partners/directory/NG/Nigeria
fetching for Norway from https://www.openerp.com/partners/directory/NO/Norway
fetching for Palestine from https://www.openerp.com/partners/directory/PS/Palestine
fetching for Paraguay from https://www.openerp.com/partners/directory/PY/Paraguay
fetching for Peru from https://www.openerp.com/partners/directory/PE/Peru
fetching for Philippines from https://www.openerp.com/partners/directory/PH/Philippines
fetching for Poland from https://www.openerp.com/partners/directory/PL/Poland
fetching for Portugal from https://www.openerp.com/partners/directory/PT/Portugal
fetching for Qatar from https://www.openerp.com/partners/directory/QA/Qatar
fetching for Romania from https://www.openerp.com/partners/directory/RO/Romania
fetching for Russian Federation from https://www.openerp.com/partners/directory/RU/Russian+Federation
fetching for Réunion from https://www.openerp.com/partners/directory/RE/R%C3%A9union
fetching for Saudi Arabia from https://www.openerp.com/partners/directory/SA/Saudi+Arabia
fetching for Senegal from https://www.openerp.com/partners/directory/SN/Senegal
fetching for Singapore from https://www.openerp.com/partners/directory/SG/Singapore
fetching for Slovenia from https://www.openerp.com/partners/directory/SI/Slovenia
fetching for South Africa from https://www.openerp.com/partners/directory/ZA/South+Africa
fetching for Spain from https://www.openerp.com/partners/directory/ES/Spain
fetching for Sudan from https://www.openerp.com/partners/directory/SD/Sudan
fetching for Suriname from https://www.openerp.com/partners/directory/SR/Suriname
fetching for Sweden from https://www.openerp.com/partners/directory/SE/Sweden
fetching for Switzerland from https://www.openerp.com/partners/directory/CH/Switzerland
fetching for Taiwan from https://www.openerp.com/partners/directory/TW/Taiwan
fetching for Thailand from https://www.openerp.com/partners/directory/TH/Thailand
fetching for Togo from https://www.openerp.com/partners/directory/TG/Togo
fetching for Tunisia from https://www.openerp.com/partners/directory/TN/Tunisia
fetching for Turkey from https://www.openerp.com/partners/directory/TR/Turkey
fetching for Uganda from https://www.openerp.com/partners/directory/UG/Uganda
fetching for United Arab Emirates from https://www.openerp.com/partners/directory/AE/United+Arab+Emirates
fetching for United Kingdom from https://www.openerp.com/partners/directory/GB/United+Kingdom
fetching for United States from https://www.openerp.com/partners/directory/US/United+States
fetching for Venezuela from https://www.openerp.com/partners/directory/VE/Venezuela
fetching for Vietnam from https://www.openerp.com/partners/directory/VN/Vietnam
fetching for Zambia from https://www.openerp.com/partners/directory/ZM/Zambia

Partner's count

Partners for Afghanistan are 1
Partners for Algeria are 3
Partners for Angola are 3
Partners for Australia are 4
Partners for Argentina are 2
Partners for Albania are 1
Partners for Austria are 5
Partners for Bangladesh are 3
Partners for Benin are 1
Partners for Cambodia are 1
Partners for Brazil are 6
Partners for Cameroon are 2
Partners for Bolivia are 2
Partners for China are 5
Partners for Chile are 2
Partners for Cape Verde are 1
Partners for Belgium are 37
Partners for Costa Rica are 2
Partners for Congo are 2
Partners for Croatia are 5
Partners for Denmark are 3
Partners for Côte d'Ivoire are 2
Partners for Canada are 14
Partners for Colombia are 6
Partners for Bulgaria are 2
Partners for Ghana are 1
Partners for Dominican Republic are 1
Partners for Estonia are 1
Partners for Ethiopia are 2
Partners for Ecuador are 5
Partners for Finland are 4
Partners for Egypt are 5
Partners for Greece are 2
Partners for Guatemala are 3
Partners for Honduras are 2
Partners for Guadeloupe are 1
Partners for Hungary are 2
Partners for Iran are 1
Partners for Iceland are 1
Partners for Germany are 16
Partners for Indonesia are 6
Partners for Ireland are 1
Partners for France are 60
Partners for Japan are 2
Partners for Libya are 2
Partners for Mayotte are 1
Partners for Macedonia are 1
Partners for Hong Kong are 7
Partners for India are 22
Partners for Malaysia are 4
Partners for Myanmar are 3
Partners for Morocco are 3
Partners for Mauritius are 1
Partners for Nepal are 1
Partners for New Caledonia are 2
Partners for Mexico are 13
Partners for Kuwait are 3
Partners for Italy are 12
Partners for Laos are 1
Partners for Netherlands are 19
Partners for Luxembourg are 4
Partners for Lebanon are 1
Partners for Lithuania are 1
Partners for Palestine are 1
Partners for Philippines are 4
Partners for Qatar are 1
Partners for Romania are 6
Partners for Portugal are 4
Partners for Poland are 1
Partners for Peru are 5
Partners for Nigeria are 8
Partners for Réunion are 1
Partners for Russian Federation are 1
Partners for New Zealand are 1
Partners for Senegal are 1
Partners for Slovenia are 1
Partners for South Africa are 3
Partners for Singapore are 3
Partners for Saudi Arabia are 11
Partners for Sudan are 1
Partners for Thailand are 3
Partners for Sweden are 1
Partners for Suriname are 1
Partners for Turkey are 1
Partners for United States are 13
Partners for Uganda are 1
Partners for Spain are 20
Partners for Switzerland are 13
Partners for Taiwan are 1
Partners for Venezuela are 1
Partners for Togo are 1
Partners for Norway are 1
Partners for United Kingdom are 7
Partners for United Arab Emirates are 6
Partners for Vietnam are 1
Partners for Tunisia are 6
Partners for Paraguay are 1
Partners for Zambia are 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment