<!DOCTYPE html>
<html>
<head>
<title>Papa Parse Player</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="papaparse.js"></script>
<script src="script.js"></script>
</head>
<body>
<div class="grid-container">
<div class="grid-25">
<label><input type="checkbox" id="download"> Download</label>
<label><input type="checkbox" id="stream"> Stream</label>
<label><input type="checkbox" id="chunk"> Chunk</label>
<label><input type="checkbox" id="worker"> Worker thread</label>
<label><input type="checkbox" id="header" disabled='true' checked> Header row</label>
<label><input type="checkbox" id="dynamicTyping"> Dynamic typing</label>
<label><input type="checkbox" id="fastmode"> Fast mode</label>
<label><input type="checkbox" id="skipEmptyLines"> Skip empty lines</label>
<label><input type="checkbox" id="step-pause"> Pause on step</label>
<label><input type="checkbox" id="print-steps"> Log each step/chunk</label>
<label>Delimiter: <input type="text" size="5" placeholder="auto" id="delimiter"> <a href="javascript:" id="insert-tab">tab</a></label>
Line Endings:
<label style="display: inline;"><input type="radio" name="newline" id="newline-auto" checked>Auto</label>
<label style="display: inline;"><input type="radio" name="newline" id="newline-n">\n</label>
<label style="display: inline;"><input type="radio" name="newline" id="newline-r">\r</label>
<label style="display: inline;"><input type="radio" name="newline" id="newline-rn">\r\n</label>
<label>Preview: <input type="number" min="0" max="1000" placeholder="default" id="preview"></label>
<label>Encoding: <input type="text" id="encoding" placeholder="default" size="10"></label>
<label>Comment char: <input type="text" size="5" maxlength="1" placeholder="default" id="comments"></label>
<label>Papa.LocalChunkSize: <input type="number" min="0" placeholder="default" id="localChunkSize"></label>
<label>Papa.RemoteChunkSize: <input type="number" min="0" placeholder="default" id="remoteChunkSize"></label>
</div>
<div class="grid-75 text-center">
<div class='bleh'></div>
<h1><a href="http://papaparse.com">Papa Parse</a> toObject</h1>
<div class='blurb'>After using <a href="https://chrome.google.com/webstore/detail/web-scraper/jnhgnonknehpejjnehehllkliplmbmhn">this</a> fantastic web scraper I wanted to turn its output to an object.<br/>
This is some simple code to do that using Papa Parser.<br/>
The sample csv data comes from the scrape I did for the neighbour.
</div>
<br />
CSV
<textarea id="input" placeholder="Input">artists,artists-href,size,song_title,link_to_download_page,link_to_download_page-href,download_link
"Pitbull","http://www.cool-midi.com/pitbull-free-midi-26.htm","141","Rain over me feat. Marc Anthony","Rain over me feat. Marc Anthony","http://www.cool-midi.com/download/pitbull-rain_over_me_feat_marc_anthony.htm","http://www.cool-midi.com/midi/p/pitbull-rain_over_me_feat_marc_anthony.mid"
"Snoop Dogg","http://www.cool-midi.com/snoop-dogg-free-midi-29.htm","23 kB","Sweat feat. David Guetta","Sweat feat. David Guetta","http://www.cool-midi.com/download/snoop_dogg-sweat_feat_david_guetta.htm","http://www.cool-midi.com/midi/s/snoop_dogg-sweat_feat_david_guetta.mid"
"Ja Rule","http://www.cool-midi.com/ja-rule-free-midi-20.htm","21 kB","Mesmerize","Mesmerize","http://www.cool-midi.com/download/ja_rule-mesmerize.htm","http://www.cool-midi.com/midi/j/ja_rule-mesmerize.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","53 kB","Me and my homies feat. Nate Dogg","Me and my homies feat. Nate Dogg","http://www.cool-midi.com/download/2_pac-me_and_my_homies_feat_nate_dogg.htm","http://www.cool-midi.com/midi/123/2_pac-me_and_my_homies_feat_nate_dogg.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","10 kB","I'm supposed to die tonight","I'm supposed to die tonight","http://www.cool-midi.com/download/50_cent-im_supposed_to_die_tonight.htm","http://www.cool-midi.com/midi/123/50_cent-im_supposed_to_die_tonight.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","45 kB","Its All About Benjamins (orchestrated rock)","Its All About Benjamins (orchestrated rock)","http://www.cool-midi.com/download/puff_daddy-its_all_about_benjamins_orchestrated_rock.htm","http://www.cool-midi.com/midi/p/puff_daddy-its_all_about_benjamins_orchestrated_rock.mid"
"Pitbull","http://www.cool-midi.com/pitbull-free-midi-26.htm","37 kB","Give me everything feat. Ne Yo Afrojack Nayer","Give me everything feat. Ne Yo Afrojack Nayer","http://www.cool-midi.com/download/pitbull-give_me_everything_feat_ne_yo_afrojack_nayer.htm","http://www.cool-midi.com/midi/p/pitbull-give_me_everything_feat_ne_yo_afrojack_nayer.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","19 kB","Role Model","Role Model","http://www.cool-midi.com/download/eminem-role_model.htm","http://www.cool-midi.com/midi/e/eminem-role_model.mid"
"Xzibit","http://www.cool-midi.com/xzibit-free-midi-34.htm","44 kB","Chris","Chris","http://www.cool-midi.com/download/xzibit-chris.htm","http://www.cool-midi.com/midi/x/xzibit-chris.mid"
"Outkast","http://www.cool-midi.com/outkast-free-midi-25.htm","23 kB","The way you move","The way you move","http://www.cool-midi.com/download/outkast-the_way_you_move.htm","http://www.cool-midi.com/midi/o/outkast-the_way_you_move.mid"
"Flo Rida","http://www.cool-midi.com/flo-rida-free-midi-16.htm","17 kB","Good feeling","Good feeling","http://www.cool-midi.com/download/flo_rida-good_feeling.htm","http://www.cool-midi.com/midi/f/flo_rida-good_feeling.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","27 kB","How we do feat. The Game","How we do feat. The Game","http://www.cool-midi.com/download/50_cent-how_we_do_feat_the_game.htm","http://www.cool-midi.com/midi/123/50_cent-how_we_do_feat_the_game.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","25 kB","One last time","One last time","http://www.cool-midi.com/download/eminem-one_last_time.htm","http://www.cool-midi.com/midi/e/eminem-one_last_time.mid"
"Snoop Dogg","http://www.cool-midi.com/snoop-dogg-free-midi-29.htm","31 kB","Gs and hustlas","Gs and hustlas","http://www.cool-midi.com/download/snoop_dogg-gs_and_hustlas.htm","http://www.cool-midi.com/midi/s/snoop_dogg-gs_and_hustlas.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","35 kB","Been Around The World","Been Around The World","http://www.cool-midi.com/download/puff_daddy-been_around_the_world.htm","http://www.cool-midi.com/midi/p/puff_daddy-been_around_the_world.mid"
"D 12","http://www.cool-midi.com/d-12-free-midi-14.htm","31 kB","Howcome","Howcome","http://www.cool-midi.com/download/d_12-howcome.htm","http://www.cool-midi.com/midi/d/d_12-howcome.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","40 kB","Empire state of mind feat. Alicia Keys","Empire state of mind feat. Alicia Keys","http://www.cool-midi.com/download/jay_z-empire_state_of_mind_feat_alicia_keys.htm","http://www.cool-midi.com/midi/j/jay_z-empire_state_of_mind_feat_alicia_keys.mid"
"Outkast","http://www.cool-midi.com/outkast-free-midi-25.htm","38 kB","So Fresh So Clean","So Fresh So Clean","http://www.cool-midi.com/download/outkast-so_fresh_so_clean.htm","http://www.cool-midi.com/midi/o/outkast-so_fresh_so_clean.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","28 kB","Not afraid","Not afraid","http://www.cool-midi.com/download/eminem-not_afraid.htm","http://www.cool-midi.com/midi/e/eminem-not_afraid.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","23 kB","Bad Meets Evil","Bad Meets Evil","http://www.cool-midi.com/download/eminem-bad_meets_evil.htm","http://www.cool-midi.com/midi/e/eminem-bad_meets_evil.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","58 kB","Will 2k","Will 2k","http://www.cool-midi.com/download/will_smith-will_2k.htm","http://www.cool-midi.com/midi/w/will_smith-will_2k.mid"
"Travie McCoy","http://www.cool-midi.com/travie-mccoy-free-midi-30.htm","64 kB","Billionaire feat. Bruno Mars","Billionaire feat. Bruno Mars","http://www.cool-midi.com/download/travie_mccoy-billionaire_feat_bruno_mars.htm","http://www.cool-midi.com/midi/t/travie_mccoy-billionaire_feat_bruno_mars.mid"
"Outkast","http://www.cool-midi.com/outkast-free-midi-25.htm","42 kB","The whole world","The whole world","http://www.cool-midi.com/download/outkast-the_whole_world.htm","http://www.cool-midi.com/midi/o/outkast-the_whole_world.mid"
"Eamon","http://www.cool-midi.com/eamon-free-midi-15.htm","33 kB","Love them hos","Love them hos","http://www.cool-midi.com/download/eamon-love_them_hos.htm","http://www.cool-midi.com/midi/e/eamon-love_them_hos.mid"
"Wiz Khalifa","http://www.cool-midi.com/wiz-khalifa-free-midi-33.htm","36 kB","Black and yellow","Black and yellow","http://www.cool-midi.com/download/wiz_khalifa-black_and_yellow.htm","http://www.cool-midi.com/midi/w/wiz_khalifa-black_and_yellow.mid"
"Timbaland","http://www.cool-midi.com/timbaland-free-midi-30.htm","39 kB","If we ever meet again feat. Katy Perry","If we ever meet again feat. Katy Perry","http://www.cool-midi.com/download/timbaland-if_we_ever_meet_again_feat_katy_perry.htm","http://www.cool-midi.com/midi/t/timbaland-if_we_ever_meet_again_feat_katy_perry.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","22 kB","The Way I Am","The Way I Am","http://www.cool-midi.com/download/eminem-the_way_i_am.htm","http://www.cool-midi.com/midi/e/eminem-the_way_i_am.mid"
"Drake","http://www.cool-midi.com/drake-free-midi-14.htm","36 kB","Take care feat. Rihanna","Take care feat. Rihanna","http://www.cool-midi.com/download/drake-take_care_feat_rihanna.htm","http://www.cool-midi.com/midi/d/drake-take_care_feat_rihanna.mid"
"Gorillaz","http://www.cool-midi.com/gorillaz-free-midi-17.htm","30 kB","Kids with guns","Kids with guns","http://www.cool-midi.com/download/gorillaz-kids_with_guns.htm","http://www.cool-midi.com/midi/g/gorillaz-kids_with_guns.mid"
"Snoop Dogg","http://www.cool-midi.com/snoop-dogg-free-midi-29.htm","30 kB","Aint no fun","Aint no fun","http://www.cool-midi.com/download/snoop_dogg-aint_no_fun.htm","http://www.cool-midi.com/midi/s/snoop_dogg-aint_no_fun.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","76 kB","Summertime","Summertime","http://www.cool-midi.com/download/will_smith-summertime.htm","http://www.cool-midi.com/midi/w/will_smith-summertime.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","121","Dear Mama","Dear Mama","http://www.cool-midi.com/download/2_pac-dear_mama.htm","http://www.cool-midi.com/midi/123/2_pac-dear_mama.mid"
"Timbaland","http://www.cool-midi.com/timbaland-free-midi-30.htm","22 kB","The way I are feat. Keri Hilson","The way I are feat. Keri Hilson","http://www.cool-midi.com/download/timbaland-the_way_i_are_feat_keri_hilson.htm","http://www.cool-midi.com/midi/t/timbaland-the_way_i_are_feat_keri_hilson.mid"
"Wu Tang Clan","http://www.cool-midi.com/wu-tang-clan-free-midi-33.htm","36 kB","Gravel Pit","Gravel Pit","http://www.cool-midi.com/download/wu_tang_clan-gravel_pit.htm","http://www.cool-midi.com/midi/w/wu_tang_clan-gravel_pit.mid"
"Q Tip","http://www.cool-midi.com/q-tip-free-midi-27.htm","13 kB","Vivrant Thing","Vivrant Thing","http://www.cool-midi.com/download/q_tip-vivrant_thing.htm","http://www.cool-midi.com/midi/q/q_tip-vivrant_thing.mid"
"Flo Rida","http://www.cool-midi.com/flo-rida-free-midi-16.htm","61 kB","Right round","Right round","http://www.cool-midi.com/download/flo_rida-right_round.htm","http://www.cool-midi.com/midi/f/flo_rida-right_round.mid"
"Psy","http://www.cool-midi.com/psy-free-midi-26.htm","130","Gangnam style (version 3)","Gangnam style (version 3)","http://www.cool-midi.com/download/psy-gangnam_style_version_3.htm","http://www.cool-midi.com/midi/p/psy-gangnam_style_version_3.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","44 kB","Angels With Dirty Faces","Angels With Dirty Faces","http://www.cool-midi.com/download/puff_daddy-angels_with_dirty_faces.htm","http://www.cool-midi.com/midi/p/puff_daddy-angels_with_dirty_faces.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","74 kB","One Step Into A World","One Step Into A World","http://www.cool-midi.com/download/puff_daddy-one_step_into_a_world.htm","http://www.cool-midi.com/midi/p/puff_daddy-one_step_into_a_world.mid"
"Nelly","http://www.cool-midi.com/nelly-free-midi-24.htm","27 kB","Country Grammar","Country Grammar","http://www.cool-midi.com/download/nelly-country_grammar.htm","http://www.cool-midi.com/midi/n/nelly-country_grammar.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","28 kB","P.I.M.P","P.I.M.P","http://www.cool-midi.com/download/50_cent-pimp.htm","http://www.cool-midi.com/midi/123/50_cent-pimp.mid"
"Gorillaz","http://www.cool-midi.com/gorillaz-free-midi-17.htm","26 kB","Rock the house","Rock the house","http://www.cool-midi.com/download/gorillaz-rock_the_house.htm","http://www.cool-midi.com/midi/g/gorillaz-rock_the_house.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","14 kB","Big pimpin'","Big pimpin'","http://www.cool-midi.com/download/jay_z-big_pimpin.htm","http://www.cool-midi.com/midi/j/jay_z-big_pimpin.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","29 kB","Satisfy You feat. RKelly","Satisfy You feat. RKelly","http://www.cool-midi.com/download/puff_daddy-satisfy_you_feat_rkelly.htm","http://www.cool-midi.com/midi/p/puff_daddy-satisfy_you_feat_rkelly.mid"
"Fort Minor","http://www.cool-midi.com/fort-minor-free-midi-16.htm","24 kB","Remember the name","Remember the name","http://www.cool-midi.com/download/fort_minor-remember_the_name.htm","http://www.cool-midi.com/midi/f/fort_minor-remember_the_name.mid"
"Fort Minor","http://www.cool-midi.com/fort-minor-free-midi-16.htm","45 kB","Where'd you go","Where'd you go","http://www.cool-midi.com/download/fort_minor-whered_you_go.htm","http://www.cool-midi.com/midi/f/fort_minor-whered_you_go.mid"
"Busta Rhymes","http://www.cool-midi.com/busta-rhymes-free-midi-12.htm","41 kB","I know what you want feat. Mariah Carey","I know what you want feat. Mariah Carey","http://www.cool-midi.com/download/busta_rhymes-i_know_what_you_want_feat_mariah_carey.htm","http://www.cool-midi.com/midi/b/busta_rhymes-i_know_what_you_want_feat_mariah_carey.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","45 kB","Its All About Benjamins (rock remix)","Its All About Benjamins (rock remix)","http://www.cool-midi.com/download/puff_daddy-its_all_about_benjamins_rock_remix.htm","http://www.cool-midi.com/midi/p/puff_daddy-its_all_about_benjamins_rock_remix.mid"
"Gorillaz","http://www.cool-midi.com/gorillaz-free-midi-17.htm","4","Clint Eastwood","Clint Eastwood","http://www.cool-midi.com/download/gorillaz-clint_eastwood.htm","http://www.cool-midi.com/midi/g/gorillaz-clint_eastwood.mid"
"Psy","http://www.cool-midi.com/psy-free-midi-26.htm","62 kB","Gentleman","Gentleman","http://www.cool-midi.com/download/psy-gentleman.htm","http://www.cool-midi.com/midi/p/psy-gentleman.mid"
"Naughty By Nature","http://www.cool-midi.com/naughty-by-nature-free-midi-24.htm","23 kB","Holiday","Holiday","http://www.cool-midi.com/download/naughty_by_nature-holiday.htm","http://www.cool-midi.com/midi/n/naughty_by_nature-holiday.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","22 kB","Ass like that","Ass like that","http://www.cool-midi.com/download/eminem-ass_like_that.htm","http://www.cool-midi.com/midi/e/eminem-ass_like_that.mid"
"Ice Cube","http://www.cool-midi.com/ice-cube-free-midi-19.htm","47 kB","Record Company Pimpin","Record Company Pimpin","http://www.cool-midi.com/download/ice_cube-record_company_pimpin.htm","http://www.cool-midi.com/midi/i/ice_cube-record_company_pimpin.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","60 kB","Piggy bank","Piggy bank","http://www.cool-midi.com/download/50_cent-piggy_bank.htm","http://www.cool-midi.com/midi/123/50_cent-piggy_bank.mid"
"Fort Minor","http://www.cool-midi.com/fort-minor-free-midi-16.htm","21 kB","Kenji","Kenji","http://www.cool-midi.com/download/fort_minor-kenji.htm","http://www.cool-midi.com/midi/f/fort_minor-kenji.mid"
"Flo Rida","http://www.cool-midi.com/flo-rida-free-midi-16.htm","39 kB","Low","Low","http://www.cool-midi.com/download/flo_rida-low.htm","http://www.cool-midi.com/midi/f/flo_rida-low.mid"
"Beastie Boys","http://www.cool-midi.com/beastie-boys-free-midi-12.htm","86 kB","Sabotage","Sabotage","http://www.cool-midi.com/download/beastie_boys-sabotage.htm","http://www.cool-midi.com/midi/b/beastie_boys-sabotage.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","26 kB","Without Me","Without Me","http://www.cool-midi.com/download/eminem-without_me.htm","http://www.cool-midi.com/midi/e/eminem-without_me.mid"
"Beastie Boys","http://www.cool-midi.com/beastie-boys-free-midi-12.htm","18 kB","Slow ride","Slow ride","http://www.cool-midi.com/download/beastie_boys-slow_ride.htm","http://www.cool-midi.com/midi/b/beastie_boys-slow_ride.mid"
"Ja Rule","http://www.cool-midi.com/ja-rule-free-midi-20.htm","23 kB","Put it on me","Put it on me","http://www.cool-midi.com/download/ja_rule-put_it_on_me.htm","http://www.cool-midi.com/midi/j/ja_rule-put_it_on_me.mid"
"Busta Rhymes","http://www.cool-midi.com/busta-rhymes-free-midi-12.htm","36 kB","Break your neck","Break your neck","http://www.cool-midi.com/download/busta_rhymes-break_your_neck.htm","http://www.cool-midi.com/midi/b/busta_rhymes-break_your_neck.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","29 kB","Ill Be Missing You feat. Faith Evans","Ill Be Missing You feat. Faith Evans","http://www.cool-midi.com/download/puff_daddy-ill_be_missing_you_feat_faith_evans.htm","http://www.cool-midi.com/midi/p/puff_daddy-ill_be_missing_you_feat_faith_evans.mid"
"DMX","http://www.cool-midi.com/dmx-free-midi-14.htm","71 kB","Its All Good","Its All Good","http://www.cool-midi.com/download/dmx-its_all_good.htm","http://www.cool-midi.com/midi/d/dmx-its_all_good.mid"
"Everlast","http://www.cool-midi.com/everlast-free-midi-15.htm","28 kB","What Its Like","What Its Like","http://www.cool-midi.com/download/everlast-what_its_like.htm","http://www.cool-midi.com/midi/e/everlast-what_its_like.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","26 kB","Guilty Conscince","Guilty Conscince","http://www.cool-midi.com/download/eminem-guilty_conscince.htm","http://www.cool-midi.com/midi/e/eminem-guilty_conscince.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","11 kB","Puke","Puke","http://www.cool-midi.com/download/eminem-puke.htm","http://www.cool-midi.com/midi/e/eminem-puke.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","22 kB","Bad boy for life","Bad boy for life","http://www.cool-midi.com/download/puff_daddy-bad_boy_for_life.htm","http://www.cool-midi.com/midi/p/puff_daddy-bad_boy_for_life.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","52 kB","Mo Money Mo Problems feat. Notorious BIG","Mo Money Mo Problems feat. Notorious BIG","http://www.cool-midi.com/download/puff_daddy-mo_money_mo_problems_feat_notorious_big.htm","http://www.cool-midi.com/midi/p/puff_daddy-mo_money_mo_problems_feat_notorious_big.mid"
"Flo Rida","http://www.cool-midi.com/flo-rida-free-midi-16.htm","112","Wild ones feat. Sia","Wild ones feat. Sia","http://www.cool-midi.com/download/flo_rida-wild_ones_feat_sia.htm","http://www.cool-midi.com/midi/f/flo_rida-wild_ones_feat_sia.mid"
"Nelly","http://www.cool-midi.com/nelly-free-midi-24.htm","63 kB","My place","My place","http://www.cool-midi.com/download/nelly-my_place.htm","http://www.cool-midi.com/midi/n/nelly-my_place.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","16 kB","Never enough","Never enough","http://www.cool-midi.com/download/eminem-never_enough.htm","http://www.cool-midi.com/midi/e/eminem-never_enough.mid"
"Fort Minor","http://www.cool-midi.com/fort-minor-free-midi-16.htm","31 kB","Slip out the back","Slip out the back","http://www.cool-midi.com/download/fort_minor-slip_out_the_back.htm","http://www.cool-midi.com/midi/f/fort_minor-slip_out_the_back.mid"
"Snoop Dogg","http://www.cool-midi.com/snoop-dogg-free-midi-29.htm","29 kB","The shiz nitz","The shiz nitz","http://www.cool-midi.com/download/snoop_dogg-the_shiz_nitz.htm","http://www.cool-midi.com/midi/s/snoop_dogg-the_shiz_nitz.mid"
"Pharrell Williams","http://www.cool-midi.com/pharrell-williams-free-midi-26.htm","82 kB","Happy","Happy","http://www.cool-midi.com/download/pharrell_williams-happy.htm","http://www.cool-midi.com/midi/p/pharrell_williams-happy.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","19 kB","Outta control","Outta control","http://www.cool-midi.com/download/50_cent-outta_control.htm","http://www.cool-midi.com/midi/123/50_cent-outta_control.mid"
"Nelly","http://www.cool-midi.com/nelly-free-midi-24.htm","28 kB","Just a dream","Just a dream","http://www.cool-midi.com/download/nelly-just_a_dream.htm","http://www.cool-midi.com/midi/n/nelly-just_a_dream.mid"
"Pitbull","http://www.cool-midi.com/pitbull-free-midi-26.htm","61 kB","I know you want me","I know you want me","http://www.cool-midi.com/download/pitbull-i_know_you_want_me.htm","http://www.cool-midi.com/midi/p/pitbull-i_know_you_want_me.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","90 kB","She wants it feat. Justin Timberlake","She wants it feat. Justin Timberlake","http://www.cool-midi.com/download/50_cent-she_wants_it_feat_justin_timberlake.htm","http://www.cool-midi.com/midi/123/50_cent-she_wants_it_feat_justin_timberlake.mid"
"Wax","http://www.cool-midi.com/wax-free-midi-33.htm","112","Rosana","Rosana","http://www.cool-midi.com/download/wax-rosana.htm","http://www.cool-midi.com/midi/w/wax-rosana.mid"
"Outkast","http://www.cool-midi.com/outkast-free-midi-25.htm","32 kB","Roses","Roses","http://www.cool-midi.com/download/outkast-roses.htm","http://www.cool-midi.com/midi/o/outkast-roses.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","49 kB","Feelin it","Feelin it","http://www.cool-midi.com/download/jay_z-feelin_it.htm","http://www.cool-midi.com/midi/j/jay_z-feelin_it.mid"
"Snoop Dogg","http://www.cool-midi.com/snoop-dogg-free-midi-29.htm","25 kB","Drop it like its hot","Drop it like its hot","http://www.cool-midi.com/download/snoop_dogg-drop_it_like_its_hot.htm","http://www.cool-midi.com/midi/s/snoop_dogg-drop_it_like_its_hot.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","59 kB","Come To Me","Come To Me","http://www.cool-midi.com/download/will_smith-come_to_me.htm","http://www.cool-midi.com/midi/w/will_smith-come_to_me.mid"
"Gorillaz","http://www.cool-midi.com/gorillaz-free-midi-17.htm","39 kB","19 - 2000","19 - 2000","http://www.cool-midi.com/download/gorillaz-19_-_2000.htm","http://www.cool-midi.com/midi/g/gorillaz-19_-_2000.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","23 kB","Ambitionz az a ridah","Ambitionz az a ridah","http://www.cool-midi.com/download/2_pac-ambitionz_az_a_ridah.htm","http://www.cool-midi.com/midi/123/2_pac-ambitionz_az_a_ridah.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","70 kB","Love the way you lie feat. Rihanna","Love the way you lie feat. Rihanna","http://www.cool-midi.com/download/eminem-love_the_way_you_lie_feat_rihanna.htm","http://www.cool-midi.com/midi/e/eminem-love_the_way_you_lie_feat_rihanna.mid"
"Missy Elliott","http://www.cool-midi.com/missy-elliott-free-midi-23.htm","26 kB","Get UR Freak On","Get UR Freak On","http://www.cool-midi.com/download/missy_elliott-get_ur_freak_on.htm","http://www.cool-midi.com/midi/m/missy_elliott-get_ur_freak_on.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","15 kB","Big weeni","Big weeni","http://www.cool-midi.com/download/eminem-big_weeni.htm","http://www.cool-midi.com/midi/e/eminem-big_weeni.mid"
"Afroman","http://www.cool-midi.com/afroman-free-midi-11.htm","9","Because I Got High","Because I Got High","http://www.cool-midi.com/download/afroman-because_i_got_high.htm","http://www.cool-midi.com/midi/a/afroman-because_i_got_high.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","37 kB","Mosh","Mosh","http://www.cool-midi.com/download/eminem-mosh.htm","http://www.cool-midi.com/midi/e/eminem-mosh.mid"
"Nelly","http://www.cool-midi.com/nelly-free-midi-24.htm","33 kB","Ei","Ei","http://www.cool-midi.com/download/nelly-ei.htm","http://www.cool-midi.com/midi/n/nelly-ei.mid"
"Naughty By Nature","http://www.cool-midi.com/naughty-by-nature-free-midi-24.htm","43 kB","Jamboree","Jamboree","http://www.cool-midi.com/download/naughty_by_nature-jamboree.htm","http://www.cool-midi.com/midi/n/naughty_by_nature-jamboree.mid"
"Psy","http://www.cool-midi.com/psy-free-midi-26.htm","130","Gangnam style (version 2)","Gangnam style (version 2)","http://www.cool-midi.com/download/psy-gangnam_style_version_2.htm","http://www.cool-midi.com/midi/p/psy-gangnam_style_version_2.mid"
"Lil Wayne","http://www.cool-midi.com/lil-wayne-free-midi-22.htm","24 kB","Mirror feat. Bruno Mars","Mirror feat. Bruno Mars","http://www.cool-midi.com/download/lil_wayne-mirror_feat_bruno_mars.htm","http://www.cool-midi.com/midi/l/lil_wayne-mirror_feat_bruno_mars.mid"
"Ja Rule","http://www.cool-midi.com/ja-rule-free-midi-20.htm","32 kB","Me and you","Me and you","http://www.cool-midi.com/download/ja_rule-me_and_you.htm","http://www.cool-midi.com/midi/j/ja_rule-me_and_you.mid"
"Beastie Boys","http://www.cool-midi.com/beastie-boys-free-midi-12.htm","23 kB","Girls","Girls","http://www.cool-midi.com/download/beastie_boys-girls.htm","http://www.cool-midi.com/midi/b/beastie_boys-girls.mid"
"DMX","http://www.cool-midi.com/dmx-free-midi-14.htm","41 kB","Party Up","Party Up","http://www.cool-midi.com/download/dmx-party_up.htm","http://www.cool-midi.com/midi/d/dmx-party_up.mid"
"Ja Rule","http://www.cool-midi.com/ja-rule-free-midi-20.htm","41 kB","Always On Time","Always On Time","http://www.cool-midi.com/download/ja_rule-always_on_time.htm","http://www.cool-midi.com/midi/j/ja_rule-always_on_time.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","40 kB","Come With Me feat. Jimmy Paige","Come With Me feat. Jimmy Paige","http://www.cool-midi.com/download/puff_daddy-come_with_me_feat_jimmy_paige.htm","http://www.cool-midi.com/midi/p/puff_daddy-come_with_me_feat_jimmy_paige.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","35 kB","Mockingbird","Mockingbird","http://www.cool-midi.com/download/eminem-mockingbird.htm","http://www.cool-midi.com/midi/e/eminem-mockingbird.mid"
"Nelly","http://www.cool-midi.com/nelly-free-midi-24.htm","28 kB","Hot in here","Hot in here","http://www.cool-midi.com/download/nelly-hot_in_here.htm","http://www.cool-midi.com/midi/n/nelly-hot_in_here.mid"
"Gorillaz","http://www.cool-midi.com/gorillaz-free-midi-17.htm","23 kB","Feel good inc","Feel good inc","http://www.cool-midi.com/download/gorillaz-feel_good_inc.htm","http://www.cool-midi.com/midi/g/gorillaz-feel_good_inc.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","29 kB","Until the end of time","Until the end of time","http://www.cool-midi.com/download/2_pac-until_the_end_of_time.htm","http://www.cool-midi.com/midi/123/2_pac-until_the_end_of_time.mid"
"Xzibit","http://www.cool-midi.com/xzibit-free-midi-34.htm","21 kB","The Foundation","The Foundation","http://www.cool-midi.com/download/xzibit-the_foundation.htm","http://www.cool-midi.com/midi/x/xzibit-the_foundation.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","40 kB","Changes","Changes","http://www.cool-midi.com/download/2_pac-changes.htm","http://www.cool-midi.com/midi/123/2_pac-changes.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","61 kB","Business","Business","http://www.cool-midi.com/download/eminem-business.htm","http://www.cool-midi.com/midi/e/eminem-business.mid"
"Psy","http://www.cool-midi.com/psy-free-midi-26.htm","61 kB","Gentleman (version 2)","Gentleman (version 2)","http://www.cool-midi.com/download/psy-gentleman_version_2.htm","http://www.cool-midi.com/midi/p/psy-gentleman_version_2.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","60 kB","Switch","Switch","http://www.cool-midi.com/download/will_smith-switch.htm","http://www.cool-midi.com/midi/w/will_smith-switch.mid"
"Will i am","http://www.cool-midi.com/will-i-am-free-midi-33.htm","46 kB","I like to move it","I like to move it","http://www.cool-midi.com/download/will_i_am-i_like_to_move_it.htm","http://www.cool-midi.com/midi/w/will_i_am-i_like_to_move_it.mid"
"Gorillaz","http://www.cool-midi.com/gorillaz-free-midi-17.htm","24 kB","On melancholy hill","On melancholy hill","http://www.cool-midi.com/download/gorillaz-on_melancholy_hill.htm","http://www.cool-midi.com/midi/g/gorillaz-on_melancholy_hill.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","74 kB","Kim","Kim","http://www.cool-midi.com/download/eminem-kim.htm","http://www.cool-midi.com/midi/e/eminem-kim.mid"
"Beastie Boys","http://www.cool-midi.com/beastie-boys-free-midi-12.htm","29 kB","Fight for your right to party","Fight for your right to party","http://www.cool-midi.com/download/beastie_boys-fight_for_your_right_to_party.htm","http://www.cool-midi.com/midi/b/beastie_boys-fight_for_your_right_to_party.mid"
"Coolio","http://www.cool-midi.com/coolio-free-midi-13.htm","21 kB","See u when u getthere","See u when u getthere","http://www.cool-midi.com/download/coolio-see_u_when_u_getthere.htm","http://www.cool-midi.com/midi/c/coolio-see_u_when_u_getthere.mid"
"Coolio","http://www.cool-midi.com/coolio-free-midi-13.htm","24 kB","Gangstas Paradise","Gangstas Paradise","http://www.cool-midi.com/download/coolio-gangstas_paradise.htm","http://www.cool-midi.com/midi/c/coolio-gangstas_paradise.mid"
"DMX","http://www.cool-midi.com/dmx-free-midi-14.htm","12 kB","Ruff Ryders","Ruff Ryders","http://www.cool-midi.com/download/dmx-ruff_ryders.htm","http://www.cool-midi.com/midi/d/dmx-ruff_ryders.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","31 kB","My first single","My first single","http://www.cool-midi.com/download/eminem-my_first_single.htm","http://www.cool-midi.com/midi/e/eminem-my_first_single.mid"
"Cypress Hill","http://www.cool-midi.com/cypress-hill-free-midi-13.htm","42 kB","Rock Superstar","Rock Superstar","http://www.cool-midi.com/download/cypress_hill-rock_superstar.htm","http://www.cool-midi.com/midi/c/cypress_hill-rock_superstar.mid"
"Psy","http://www.cool-midi.com/psy-free-midi-26.htm","28 kB","Gangnam style (version 4)","Gangnam style (version 4)","http://www.cool-midi.com/download/psy-gangnam_style_version_4.htm","http://www.cool-midi.com/midi/p/psy-gangnam_style_version_4.mid"
"Mattafix","http://www.cool-midi.com/mattafix-free-midi-23.htm","56 kB","Big city life","Big city life","http://www.cool-midi.com/download/mattafix-big_city_life.htm","http://www.cool-midi.com/midi/m/mattafix-big_city_life.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","60 kB","Men in black","Men in black","http://www.cool-midi.com/download/will_smith-men_in_black.htm","http://www.cool-midi.com/midi/w/will_smith-men_in_black.mid"
"Psy","http://www.cool-midi.com/psy-free-midi-26.htm","92 kB","Gangnam style (best version)","Gangnam style (best version)","http://www.cool-midi.com/download/psy-gangnam_style_best_version.htm","http://www.cool-midi.com/midi/p/psy-gangnam_style_best_version.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","53 kB","Crazy in love","Crazy in love","http://www.cool-midi.com/download/eminem-crazy_in_love.htm","http://www.cool-midi.com/midi/e/eminem-crazy_in_love.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","35 kB","Cleanin out my closet","Cleanin out my closet","http://www.cool-midi.com/download/eminem-cleanin_out_my_closet.htm","http://www.cool-midi.com/midi/e/eminem-cleanin_out_my_closet.mid"
"Iggy Azalea","http://www.cool-midi.com/iggy-azalea-free-midi-19.htm","15 kB","Fancy feat. Charli XCX","Fancy feat. Charli XCX","http://www.cool-midi.com/download/iggy_azalea-fancy_feat_charli_xcx.htm","http://www.cool-midi.com/midi/i/iggy_azalea-fancy_feat_charli_xcx.mid"
"Flo Rida","http://www.cool-midi.com/flo-rida-free-midi-16.htm","30 kB","Club can't handle me feat. David Guetta","Club can't handle me feat. David Guetta","http://www.cool-midi.com/download/flo_rida-club_cant_handle_me_feat_david_guetta.htm","http://www.cool-midi.com/midi/f/flo_rida-club_cant_handle_me_feat_david_guetta.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","43 kB","Just lose it","Just lose it","http://www.cool-midi.com/download/eminem-just_lose_it.htm","http://www.cool-midi.com/midi/e/eminem-just_lose_it.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","64 kB","Its All About Benjamins","Its All About Benjamins","http://www.cool-midi.com/download/puff_daddy-its_all_about_benjamins.htm","http://www.cool-midi.com/midi/p/puff_daddy-its_all_about_benjamins.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","44 kB","In da club","In da club","http://www.cool-midi.com/download/50_cent-in_da_club.htm","http://www.cool-midi.com/midi/123/50_cent-in_da_club.mid"
"Drake","http://www.cool-midi.com/drake-free-midi-14.htm","34 kB","Find your love","Find your love","http://www.cool-midi.com/download/drake-find_your_love.htm","http://www.cool-midi.com/midi/d/drake-find_your_love.mid"
"Timbaland","http://www.cool-midi.com/timbaland-free-midi-30.htm","44 kB","If we ever meet again feat. Katy Perry (version 2)","If we ever meet again feat. Katy Perry (version 2)","http://www.cool-midi.com/download/timbaland-if_we_ever_meet_again_feat_katy_perry_version_2.htm","http://www.cool-midi.com/midi/t/timbaland-if_we_ever_meet_again_feat_katy_perry_version_2.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","29 kB","Sunshine","Sunshine","http://www.cool-midi.com/download/jay_z-sunshine.htm","http://www.cool-midi.com/midi/j/jay_z-sunshine.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","27 kB","The Real Slim Shady","The Real Slim Shady","http://www.cool-midi.com/download/eminem-the_real_slim_shady.htm","http://www.cool-midi.com/midi/e/eminem-the_real_slim_shady.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","54 kB","Hate it or love it feat. The Game","Hate it or love it feat. The Game","http://www.cool-midi.com/download/50_cent-hate_it_or_love_it_feat_the_game.htm","http://www.cool-midi.com/midi/123/50_cent-hate_it_or_love_it_feat_the_game.mid"
"Outkast","http://www.cool-midi.com/outkast-free-midi-25.htm","60 kB","Hey Ya","Hey Ya","http://www.cool-midi.com/download/outkast-hey_ya.htm","http://www.cool-midi.com/midi/o/outkast-hey_ya.mid"
"Nelly","http://www.cool-midi.com/nelly-free-midi-24.htm","21 kB","Dilemma feat. Kelly","Dilemma feat. Kelly","http://www.cool-midi.com/download/nelly-dilemma_feat_kelly.htm","http://www.cool-midi.com/midi/n/nelly-dilemma_feat_kelly.mid"
"Drake","http://www.cool-midi.com/drake-free-midi-14.htm","17 kB","Headline","Headline","http://www.cool-midi.com/download/drake-headline.htm","http://www.cool-midi.com/midi/d/drake-headline.mid"
"DJ Quad City","http://www.cool-midi.com/dj-quad-city-free-midi-14.htm","40 kB","Ride That Train","Ride That Train","http://www.cool-midi.com/download/dj_quad_city-ride_that_train.htm","http://www.cool-midi.com/midi/d/dj_quad_city-ride_that_train.mid"
"Puff Daddy","http://www.cool-midi.com/puff-daddy-free-midi-26.htm","22 kB","Shake ya tailfeather","Shake ya tailfeather","http://www.cool-midi.com/download/puff_daddy-shake_ya_tailfeather.htm","http://www.cool-midi.com/midi/p/puff_daddy-shake_ya_tailfeather.mid"
"Pharrell Williams","http://www.cool-midi.com/pharrell-williams-free-midi-26.htm","28 kB","Marilyn Monroe","Marilyn Monroe","http://www.cool-midi.com/download/pharrell_williams-marilyn_monroe.htm","http://www.cool-midi.com/midi/p/pharrell_williams-marilyn_monroe.mid"
"Busta Rhymes","http://www.cool-midi.com/busta-rhymes-free-midi-12.htm","62 kB","Put your hands where my eyes could see","Put your hands where my eyes could see","http://www.cool-midi.com/download/busta_rhymes-put_your_hands_where_my_eyes_could_see.htm","http://www.cool-midi.com/midi/b/busta_rhymes-put_your_hands_where_my_eyes_could_see.mid"
"Dr Dre","http://www.cool-midi.com/dr-dre-free-midi-14.htm","47 kB","Still Dre feat. Snoop Dog","Still Dre feat. Snoop Dog","http://www.cool-midi.com/download/dr_dre-still_dre_feat_snoop_dog.htm","http://www.cool-midi.com/midi/d/dr_dre-still_dre_feat_snoop_dog.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","27 kB","Just a lil bit","Just a lil bit","http://www.cool-midi.com/download/50_cent-just_a_lil_bit.htm","http://www.cool-midi.com/midi/123/50_cent-just_a_lil_bit.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","17 kB","Rain man","Rain man","http://www.cool-midi.com/download/eminem-rain_man.htm","http://www.cool-midi.com/midi/e/eminem-rain_man.mid"
"Eve","http://www.cool-midi.com/eve-free-midi-15.htm","24 kB","Gangsta lovin","Gangsta lovin","http://www.cool-midi.com/download/eve-gangsta_lovin.htm","http://www.cool-midi.com/midi/e/eve-gangsta_lovin.mid"
"Outkast","http://www.cool-midi.com/outkast-free-midi-25.htm","32 kB","Miss Jackson","Miss Jackson","http://www.cool-midi.com/download/outkast-miss_jackson.htm","http://www.cool-midi.com/midi/o/outkast-miss_jackson.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","40 kB","Disco inferno","Disco inferno","http://www.cool-midi.com/download/50_cent-disco_inferno.htm","http://www.cool-midi.com/midi/123/50_cent-disco_inferno.mid"
"Mattafix","http://www.cool-midi.com/mattafix-free-midi-23.htm","88 kB","Living darfur","Living darfur","http://www.cool-midi.com/download/mattafix-living_darfur.htm","http://www.cool-midi.com/midi/m/mattafix-living_darfur.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","60 kB","Hard Knock Life","Hard Knock Life","http://www.cool-midi.com/download/jay_z-hard_knock_life.htm","http://www.cool-midi.com/midi/j/jay_z-hard_knock_life.mid"
"Will i am","http://www.cool-midi.com/will-i-am-free-midi-33.htm","28 kB","Scream and shout feat. Britney Spears","Scream and shout feat. Britney Spears","http://www.cool-midi.com/download/will_i_am-scream_and_shout_feat_britney_spears.htm","http://www.cool-midi.com/midi/w/will_i_am-scream_and_shout_feat_britney_spears.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","35 kB","God gave me style","God gave me style","http://www.cool-midi.com/download/50_cent-god_gave_me_style.htm","http://www.cool-midi.com/midi/123/50_cent-god_gave_me_style.mid"
"Beastie Boys","http://www.cool-midi.com/beastie-boys-free-midi-12.htm","28 kB","Intergalactic","Intergalactic","http://www.cool-midi.com/download/beastie_boys-intergalactic.htm","http://www.cool-midi.com/midi/b/beastie_boys-intergalactic.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","43 kB","Can I get a","Can I get a","http://www.cool-midi.com/download/jay_z-can_i_get_a.htm","http://www.cool-midi.com/midi/j/jay_z-can_i_get_a.mid"
"D 12","http://www.cool-midi.com/d-12-free-midi-14.htm","43 kB","Purple Hills","Purple Hills","http://www.cool-midi.com/download/d_12-purple_hills.htm","http://www.cool-midi.com/midi/d/d_12-purple_hills.mid"
"K maro","http://www.cool-midi.com/k-maro-free-midi-21.htm","57 kB","Crazy","Crazy","http://www.cool-midi.com/download/k_maro-crazy.htm","http://www.cool-midi.com/midi/k/k_maro-crazy.mid"
"Everlast","http://www.cool-midi.com/everlast-free-midi-15.htm","65 kB","Get Down","Get Down","http://www.cool-midi.com/download/everlast-get_down.htm","http://www.cool-midi.com/midi/e/everlast-get_down.mid"
"Ice Cube","http://www.cool-midi.com/ice-cube-free-midi-19.htm","41 kB","Ghetto Vet","Ghetto Vet","http://www.cool-midi.com/download/ice_cube-ghetto_vet.htm","http://www.cool-midi.com/midi/i/ice_cube-ghetto_vet.mid"
"K maro","http://www.cool-midi.com/k-maro-free-midi-21.htm","64 kB","Femme like you","Femme like you","http://www.cool-midi.com/download/k_maro-femme_like_you.htm","http://www.cool-midi.com/midi/k/k_maro-femme_like_you.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","20 kB","I aint mad at cha","I aint mad at cha","http://www.cool-midi.com/download/2_pac-i_aint_mad_at_cha.htm","http://www.cool-midi.com/midi/123/2_pac-i_aint_mad_at_cha.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","50 kB","Gettin' jiggy wit it","Gettin' jiggy wit it","http://www.cool-midi.com/download/will_smith-gettin_jiggy_wit_it.htm","http://www.cool-midi.com/midi/w/will_smith-gettin_jiggy_wit_it.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","21 kB","Bully","Bully","http://www.cool-midi.com/download/eminem-bully.htm","http://www.cool-midi.com/midi/e/eminem-bully.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","27 kB","One shot 2 shot","One shot 2 shot","http://www.cool-midi.com/download/eminem-one_shot_2_shot.htm","http://www.cool-midi.com/midi/e/eminem-one_shot_2_shot.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","26 kB","Patiently waiting","Patiently waiting","http://www.cool-midi.com/download/50_cent-patiently_waiting.htm","http://www.cool-midi.com/midi/123/50_cent-patiently_waiting.mid"
"Ja Rule","http://www.cool-midi.com/ja-rule-free-midi-20.htm","18 kB","Livin it up","Livin it up","http://www.cool-midi.com/download/ja_rule-livin_it_up.htm","http://www.cool-midi.com/midi/j/ja_rule-livin_it_up.mid"
"Gorillaz","http://www.cool-midi.com/gorillaz-free-midi-17.htm","49 kB","Dare","Dare","http://www.cool-midi.com/download/gorillaz-dare.htm","http://www.cool-midi.com/midi/g/gorillaz-dare.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","33 kB","Toy soldiers","Toy soldiers","http://www.cool-midi.com/download/eminem-toy_soldiers.htm","http://www.cool-midi.com/midi/e/eminem-toy_soldiers.mid"
"Ja Rule","http://www.cool-midi.com/ja-rule-free-midi-20.htm","34 kB","Never again","Never again","http://www.cool-midi.com/download/ja_rule-never_again.htm","http://www.cool-midi.com/midi/j/ja_rule-never_again.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","38 kB","Candy shop","Candy shop","http://www.cool-midi.com/download/50_cent-candy_shop.htm","http://www.cool-midi.com/midi/123/50_cent-candy_shop.mid"
"Coolio","http://www.cool-midi.com/coolio-free-midi-13.htm","64 kB","Fantastic voyage","Fantastic voyage","http://www.cool-midi.com/download/coolio-fantastic_voyage.htm","http://www.cool-midi.com/midi/c/coolio-fantastic_voyage.mid"
"Snoop Dogg","http://www.cool-midi.com/snoop-dogg-free-midi-29.htm","25 kB","Loosen Control","Loosen Control","http://www.cool-midi.com/download/snoop_dogg-loosen_control.htm","http://www.cool-midi.com/midi/s/snoop_dogg-loosen_control.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","71 kB","How do you want it","How do you want it","http://www.cool-midi.com/download/2_pac-how_do_you_want_it.htm","http://www.cool-midi.com/midi/123/2_pac-how_do_you_want_it.mid"
"Dr Dre","http://www.cool-midi.com/dr-dre-free-midi-14.htm","15 kB","The Next Episode","The Next Episode","http://www.cool-midi.com/download/dr_dre-the_next_episode.htm","http://www.cool-midi.com/midi/d/dr_dre-the_next_episode.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","27 kB","Girl's best friend","Girl's best friend","http://www.cool-midi.com/download/jay_z-girls_best_friend.htm","http://www.cool-midi.com/midi/j/jay_z-girls_best_friend.mid"
"Nelly","http://www.cool-midi.com/nelly-free-midi-24.htm","20 kB","Luven Me","Luven Me","http://www.cool-midi.com/download/nelly-luven_me.htm","http://www.cool-midi.com/midi/n/nelly-luven_me.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","14 kB","Space bound (piano version)","Space bound (piano version)","http://www.cool-midi.com/download/eminem-space_bound_piano_version.htm","http://www.cool-midi.com/midi/e/eminem-space_bound_piano_version.mid"
"Psy","http://www.cool-midi.com/psy-free-midi-26.htm","125","Gangnam style","Gangnam style","http://www.cool-midi.com/download/psy-gangnam_style.htm","http://www.cool-midi.com/midi/p/psy-gangnam_style.mid"
"Snoop Dogg","http://www.cool-midi.com/snoop-dogg-free-midi-29.htm","37 kB","Murder was the case","Murder was the case","http://www.cool-midi.com/download/snoop_dogg-murder_was_the_case.htm","http://www.cool-midi.com/midi/s/snoop_dogg-murder_was_the_case.mid"
"D 12","http://www.cool-midi.com/d-12-free-midi-14.htm","15 kB","My band","My band","http://www.cool-midi.com/download/d_12-my_band.htm","http://www.cool-midi.com/midi/d/d_12-my_band.mid"
"Timbaland","http://www.cool-midi.com/timbaland-free-midi-30.htm","29 kB","Apologize feat. One Republic","Apologize feat. One Republic","http://www.cool-midi.com/download/timbaland-apologize_feat_one_republic.htm","http://www.cool-midi.com/midi/t/timbaland-apologize_feat_one_republic.mid"
"Knaan","http://www.cool-midi.com/knaan-free-midi-21.htm","48 kB","Wavin flag","Wavin flag","http://www.cool-midi.com/download/knaan-wavin_flag.htm","http://www.cool-midi.com/midi/k/knaan-wavin_flag.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","34 kB","Renagade","Renagade","http://www.cool-midi.com/download/jay_z-renagade.htm","http://www.cool-midi.com/midi/j/jay_z-renagade.mid"
"Eamon","http://www.cool-midi.com/eamon-free-midi-15.htm","19 kB","F*ck it (I dont want you back)","F*ck it (I dont want you back)","http://www.cool-midi.com/download/eamon-fck_it_i_dont_want_you_back.htm","http://www.cool-midi.com/midi/e/eamon-fck_it_i_dont_want_you_back.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","24 kB","Superman","Superman","http://www.cool-midi.com/download/eminem-superman.htm","http://www.cool-midi.com/midi/e/eminem-superman.mid"
"Pitbull","http://www.cool-midi.com/pitbull-free-midi-26.htm","60 kB","We are one (ole ola) feat. Jennifer Lopez","We are one (ole ola) feat. Jennifer Lopez","http://www.cool-midi.com/download/pitbull-we_are_one_ole_ola_feat_jennifer_lopez.htm","http://www.cool-midi.com/midi/p/pitbull-we_are_one_ole_ola_feat_jennifer_lopez.mid"
"Will i am","http://www.cool-midi.com/will-i-am-free-midi-33.htm","11 kB","Fall down","Fall down","http://www.cool-midi.com/download/will_i_am-fall_down.htm","http://www.cool-midi.com/midi/w/will_i_am-fall_down.mid"
"Flo Rida","http://www.cool-midi.com/flo-rida-free-midi-16.htm","98 kB","Whistle","Whistle","http://www.cool-midi.com/download/flo_rida-whistle.htm","http://www.cool-midi.com/midi/f/flo_rida-whistle.mid"
"Missy Elliott","http://www.cool-midi.com/missy-elliott-free-midi-23.htm","72 kB","Lose control feat. Ciara Fat Man Scoop","Lose control feat. Ciara Fat Man Scoop","http://www.cool-midi.com/download/missy_elliott-lose_control_feat_ciara_fat_man_scoop.htm","http://www.cool-midi.com/midi/m/missy_elliott-lose_control_feat_ciara_fat_man_scoop.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","42 kB","Wild Wild West","Wild Wild West","http://www.cool-midi.com/download/will_smith-wild_wild_west.htm","http://www.cool-midi.com/midi/w/will_smith-wild_wild_west.mid"
"2 Pac","http://www.cool-midi.com/2-pac-free-midi-37.htm","34 kB","Lost Souls","Lost Souls","http://www.cool-midi.com/download/2_pac-lost_souls.htm","http://www.cool-midi.com/midi/123/2_pac-lost_souls.mid"
"Outkast","http://www.cool-midi.com/outkast-free-midi-25.htm","15 kB","Bob","Bob","http://www.cool-midi.com/download/outkast-bob.htm","http://www.cool-midi.com/midi/o/outkast-bob.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","34 kB","Stan","Stan","http://www.cool-midi.com/download/eminem-stan.htm","http://www.cool-midi.com/midi/e/eminem-stan.mid"
"Busta Rhymes","http://www.cool-midi.com/busta-rhymes-free-midi-12.htm","15 kB","Turn it up (fir it up)","Turn it up (fir it up)","http://www.cool-midi.com/download/busta_rhymes-turn_it_up_fir_it_up.htm","http://www.cool-midi.com/midi/b/busta_rhymes-turn_it_up_fir_it_up.mid"
"Will Smith","http://www.cool-midi.com/will-smith-free-midi-33.htm","54 kB","Just the two of us","Just the two of us","http://www.cool-midi.com/download/will_smith-just_the_two_of_us.htm","http://www.cool-midi.com/midi/w/will_smith-just_the_two_of_us.mid"
"Gym Class Heroes","http://www.cool-midi.com/gym-class-heroes-free-midi-17.htm","10 kB","Stereo hearts feat. Adam Levine","Stereo hearts feat. Adam Levine","http://www.cool-midi.com/download/gym_class_heroes-stereo_hearts_feat_adam_levine.htm","http://www.cool-midi.com/midi/g/gym_class_heroes-stereo_hearts_feat_adam_levine.mid"
"50 Cent","http://www.cool-midi.com/50-cent-free-midi-37.htm","30 kB","Position of power","Position of power","http://www.cool-midi.com/download/50_cent-position_of_power.htm","http://www.cool-midi.com/midi/123/50_cent-position_of_power.mid"
"Dr Dre","http://www.cool-midi.com/dr-dre-free-midi-14.htm","30 kB","Keep their heads ringing","Keep their heads ringing","http://www.cool-midi.com/download/dr_dre-keep_their_heads_ringing.htm","http://www.cool-midi.com/midi/d/dr_dre-keep_their_heads_ringing.mid"
"Busta Rhymes","http://www.cool-midi.com/busta-rhymes-free-midi-12.htm","61 kB","Whoo ha","Whoo ha","http://www.cool-midi.com/download/busta_rhymes-whoo_ha.htm","http://www.cool-midi.com/midi/b/busta_rhymes-whoo_ha.mid"
"Pitbull","http://www.cool-midi.com/pitbull-free-midi-26.htm","96 kB","Timber feat. Kesha","Timber feat. Kesha","http://www.cool-midi.com/download/pitbull-timber_feat_kesha.htm","http://www.cool-midi.com/midi/p/pitbull-timber_feat_kesha.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","33 kB","Yellow brick road","Yellow brick road","http://www.cool-midi.com/download/eminem-yellow_brick_road.htm","http://www.cool-midi.com/midi/e/eminem-yellow_brick_road.mid"
"Fugees","http://www.cool-midi.com/fugees-free-midi-16.htm","12 kB","Killing Me Softly","Killing Me Softly","http://www.cool-midi.com/download/fugees-killing_me_softly.htm","http://www.cool-midi.com/midi/f/fugees-killing_me_softly.mid"
"Eminem","http://www.cool-midi.com/eminem-free-midi-15.htm","13 kB","My Name Is","My Name Is","http://www.cool-midi.com/download/eminem-my_name_is.htm","http://www.cool-midi.com/midi/e/eminem-my_name_is.mid"
"Jay Z","http://www.cool-midi.com/jay-z-free-midi-20.htm","26 kB","Young forever feat. Mr Hudson","Young forever feat. Mr Hudson","http://www.cool-midi.com/download/jay_z-young_forever_feat_mr_hudson.htm","http://www.cool-midi.com/midi/j/jay_z-young_forever_feat_mr_hudson.mid"</textarea>
Template
<textarea id="template" placeholder="Input">{
"_artists": {
"_song_title": {
"size": "_size",
"link": "_download_link"
}
}
}</textarea>
<!-- <br>
<b>or</b>
<br>
<input type="file" id="files" multiple> -->
<br><br>
<button id="submit-parse">Parse</button>
<!--
<button id="submit-unparse">Unparse</button> -->
<br><br>
<i>Open the Console in your browser's inspector tools to see results.</i>
</div>
</div>
</body>
</html>
function toObject(data, template) {
var result = {};
data.forEach(function(data) {
doObject(result, template, data);
})
return result;
}
function doObject(root, templateRoot, data) {
Object.keys(templateRoot).forEach(function(key) {
if (key[0] == '_') {
var k = key.substring(1);
if (!root[data[k]]) root[data[k]] = {};
doObject(root[data[k]], templateRoot[key], data);
} else {
var value = templateRoot[key];
var v = value.substring(1);
if (value[0] == '_') {
root[key] = data[v];
} else {
root[key] = value;
}
}
});
}
function listProp(data, prop){
result=[];
data.forEach(function(data){
if(data[prop])result.push(data[prop]);
});
return result;
}
var stepped = 0,
chunks = 0,
rows = 0;
var start, end;
var parser;
var pauseChecked = false;
var printStepChecked = false;
$(function() {
$('#submit-parse').click(function() {
stepped = 0;
chunks = 0;
rows = 0;
var txt = $('#input').val();
var template = JSON.parse($('#template').val());
var localChunkSize = $('#localChunkSize').val();
var remoteChunkSize = $('#remoteChunkSize').val();
var config = buildConfig();
// NOTE: Chunk size does not get reset if changed and then set back to empty/default value
if (localChunkSize)
Papa.LocalChunkSize = localChunkSize;
if (remoteChunkSize)
Papa.RemoteChunkSize = remoteChunkSize;
pauseChecked = $('#step-pause').prop('checked');
printStepChecked = $('#print-steps').prop('checked');
start = performance.now();
results = Papa.parse(txt, config);
console.log("Results data avaible with the results variable and the rendered object is obj");
console.log("Synchronous parse results:", results);
obj = toObject(results.data, template);
console.log(obj);
});
$('#insert-tab').click(function() {
$('#delimiter').val('\t');
});
});
function buildConfig() {
return {
delimiter: $('#delimiter').val(),
newline: getLineEnding(),
header: true,
dynamicTyping: $('#dynamicTyping').prop('checked'),
preview: parseInt($('#preview').val() || 0),
step: $('#stream').prop('checked') ? stepFn : undefined,
encoding: $('#encoding').val(),
worker: $('#worker').prop('checked'),
comments: $('#comments').val(),
complete: completeFn,
error: errorFn,
download: $('#download').prop('checked'),
fastMode: $('#fastmode').prop('checked'),
skipEmptyLines: $('#skipEmptyLines').prop('checked'),
chunk: $('#chunk').prop('checked') ? chunkFn : undefined,
beforeFirstChunk: undefined,
};
function getLineEnding() {
if ($('#newline-n').is(':checked'))
return "\n";
else if ($('#newline-r').is(':checked'))
return "\r";
else if ($('#newline-rn').is(':checked'))
return "\r\n";
else
return "";
}
}
function stepFn(results, parserHandle) {
stepped++;
rows += results.data.length;
parser = parserHandle;
if (pauseChecked) {
console.log(results, results.data[0]);
parserHandle.pause();
return;
}
if (printStepChecked)
console.log(results, results.data[0]);
}
function chunkFn(results, streamer, file) {
if (!results)
return;
chunks++;
rows += results.data.length;
parser = streamer;
if (printStepChecked)
console.log("Chunk data:", results.data.length, results);
if (pauseChecked) {
console.log("Pausing; " + results.data.length + " rows in chunk; file:", file);
streamer.pause();
return;
}
}
function errorFn(error, file) {
console.log("ERROR:", error, file);
}
function completeFn() {
end = performance.now();
if (!$('#stream').prop('checked') && !$('#chunk').prop('checked') && arguments[0] && arguments[0].data)
rows = arguments[0].data.length;
console.log("Finished input (async). Time:", end - start, arguments);
console.log("Rows:", rows, "Stepped:", stepped, "Chunks:", chunks);
}
body {
font-family: 'Source Sans Pro', sans-serif;
}
h1 {
text-align: center;
}
textarea,
button {
font-size: 14px;
}
textarea {
box-sizing: border-box;
font: 14px/1.25em Menlo, Monaco, 'Courier New', monospace;
width: 100%;
padding: 10px;
max-width: 900px;
height: 200px;
}
button {
padding: 10px 50px;
font-size: 20px;
}
label {
display: block;
}
input[type=number] {
width: 55px;
}
.text-center {
text-align: center;
}
/* ============================================ */
/* This file has a mobile-to-desktop breakpoint */
/* ============================================ */
@media screen and (max-width: 400px) {
@-ms-viewport {
width: 320px;
}
}
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.grid-container:before, .clearfix:before,
.grid-container:after,
.clearfix:after {
content: ".";
display: block;
overflow: hidden;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.grid-container:after, .clearfix:after {
clear: both;
}
.grid-container {
margin-left: auto;
margin-right: auto;
max-width: 1200px;
padding-left: 10px;
padding-right: 10px;
}
.grid-5, .mobile-grid-5, .grid-10, .mobile-grid-10, .grid-15, .mobile-grid-15, .grid-20, .mobile-grid-20, .grid-25, .mobile-grid-25, .grid-30, .mobile-grid-30, .grid-35, .mobile-grid-35, .grid-40, .mobile-grid-40, .grid-45, .mobile-grid-45, .grid-50, .mobile-grid-50, .grid-55, .mobile-grid-55, .grid-60, .mobile-grid-60, .grid-65, .mobile-grid-65, .grid-70, .mobile-grid-70, .grid-75, .mobile-grid-75, .grid-80, .mobile-grid-80, .grid-85, .mobile-grid-85, .grid-90, .mobile-grid-90, .grid-95, .mobile-grid-95, .grid-100, .mobile-grid-100, .grid-33, .mobile-grid-33, .grid-66, .mobile-grid-66 {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding-left: 10px;
padding-right: 10px;
}
.grid-parent {
padding-left: 0;
padding-right: 0;
}
@media screen and (max-width: 767px) {
.mobile-grid-100:before,
.mobile-grid-100:after {
content: ".";
display: block;
overflow: hidden;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.mobile-grid-100:after {
clear: both;
}
.mobile-push-5, .mobile-pull-5, .mobile-push-10, .mobile-pull-10, .mobile-push-15, .mobile-pull-15, .mobile-push-20, .mobile-pull-20, .mobile-push-25, .mobile-pull-25, .mobile-push-30, .mobile-pull-30, .mobile-push-35, .mobile-pull-35, .mobile-push-40, .mobile-pull-40, .mobile-push-45, .mobile-pull-45, .mobile-push-50, .mobile-pull-50, .mobile-push-55, .mobile-pull-55, .mobile-push-60, .mobile-pull-60, .mobile-push-65, .mobile-pull-65, .mobile-push-70, .mobile-pull-70, .mobile-push-75, .mobile-pull-75, .mobile-push-80, .mobile-pull-80, .mobile-push-85, .mobile-pull-85, .mobile-push-90, .mobile-pull-90, .mobile-push-95, .mobile-pull-95, .mobile-push-33, .mobile-pull-33, .mobile-push-66, .mobile-pull-66 {
position: relative;
}
.hide-on-mobile {
display: none !important;
}
.mobile-grid-5 {
float: left;
width: 5%;
}
.mobile-prefix-5 {
margin-left: 5%;
}
.mobile-suffix-5 {
margin-right: 5%;
}
.mobile-push-5 {
left: 5%;
}
.mobile-pull-5 {
left: -5%;
}
.mobile-grid-10 {
float: left;
width: 10%;
}
.mobile-prefix-10 {
margin-left: 10%;
}
.mobile-suffix-10 {
margin-right: 10%;
}
.mobile-push-10 {
left: 10%;
}
.mobile-pull-10 {
left: -10%;
}
.mobile-grid-15 {
float: left;
width: 15%;
}
.mobile-prefix-15 {
margin-left: 15%;
}
.mobile-suffix-15 {
margin-right: 15%;
}
.mobile-push-15 {
left: 15%;
}
.mobile-pull-15 {
left: -15%;
}
.mobile-grid-20 {
float: left;
width: 20%;
}
.mobile-prefix-20 {
margin-left: 20%;
}
.mobile-suffix-20 {
margin-right: 20%;
}
.mobile-push-20 {
left: 20%;
}
.mobile-pull-20 {
left: -20%;
}
.mobile-grid-25 {
float: left;
width: 25%;
}
.mobile-prefix-25 {
margin-left: 25%;
}
.mobile-suffix-25 {
margin-right: 25%;
}
.mobile-push-25 {
left: 25%;
}
.mobile-pull-25 {
left: -25%;
}
.mobile-grid-30 {
float: left;
width: 30%;
}
.mobile-prefix-30 {
margin-left: 30%;
}
.mobile-suffix-30 {
margin-right: 30%;
}
.mobile-push-30 {
left: 30%;
}
.mobile-pull-30 {
left: -30%;
}
.mobile-grid-35 {
float: left;
width: 35%;
}
.mobile-prefix-35 {
margin-left: 35%;
}
.mobile-suffix-35 {
margin-right: 35%;
}
.mobile-push-35 {
left: 35%;
}
.mobile-pull-35 {
left: -35%;
}
.mobile-grid-40 {
float: left;
width: 40%;
}
.mobile-prefix-40 {
margin-left: 40%;
}
.mobile-suffix-40 {
margin-right: 40%;
}
.mobile-push-40 {
left: 40%;
}
.mobile-pull-40 {
left: -40%;
}
.mobile-grid-45 {
float: left;
width: 45%;
}
.mobile-prefix-45 {
margin-left: 45%;
}
.mobile-suffix-45 {
margin-right: 45%;
}
.mobile-push-45 {
left: 45%;
}
.mobile-pull-45 {
left: -45%;
}
.mobile-grid-50 {
float: left;
width: 50%;
}
.mobile-prefix-50 {
margin-left: 50%;
}
.mobile-suffix-50 {
margin-right: 50%;
}
.mobile-push-50 {
left: 50%;
}
.mobile-pull-50 {
left: -50%;
}
.mobile-grid-55 {
float: left;
width: 55%;
}
.mobile-prefix-55 {
margin-left: 55%;
}
.mobile-suffix-55 {
margin-right: 55%;
}
.mobile-push-55 {
left: 55%;
}
.mobile-pull-55 {
left: -55%;
}
.mobile-grid-60 {
float: left;
width: 60%;
}
.mobile-prefix-60 {
margin-left: 60%;
}
.mobile-suffix-60 {
margin-right: 60%;
}
.mobile-push-60 {
left: 60%;
}
.mobile-pull-60 {
left: -60%;
}
.mobile-grid-65 {
float: left;
width: 65%;
}
.mobile-prefix-65 {
margin-left: 65%;
}
.mobile-suffix-65 {
margin-right: 65%;
}
.mobile-push-65 {
left: 65%;
}
.mobile-pull-65 {
left: -65%;
}
.mobile-grid-70 {
float: left;
width: 70%;
}
.mobile-prefix-70 {
margin-left: 70%;
}
.mobile-suffix-70 {
margin-right: 70%;
}
.mobile-push-70 {
left: 70%;
}
.mobile-pull-70 {
left: -70%;
}
.mobile-grid-75 {
float: left;
width: 75%;
}
.mobile-prefix-75 {
margin-left: 75%;
}
.mobile-suffix-75 {
margin-right: 75%;
}
.mobile-push-75 {
left: 75%;
}
.mobile-pull-75 {
left: -75%;
}
.mobile-grid-80 {
float: left;
width: 80%;
}
.mobile-prefix-80 {
margin-left: 80%;
}
.mobile-suffix-80 {
margin-right: 80%;
}
.mobile-push-80 {
left: 80%;
}
.mobile-pull-80 {
left: -80%;
}
.mobile-grid-85 {
float: left;
width: 85%;
}
.mobile-prefix-85 {
margin-left: 85%;
}
.mobile-suffix-85 {
margin-right: 85%;
}
.mobile-push-85 {
left: 85%;
}
.mobile-pull-85 {
left: -85%;
}
.mobile-grid-90 {
float: left;
width: 90%;
}
.mobile-prefix-90 {
margin-left: 90%;
}
.mobile-suffix-90 {
margin-right: 90%;
}
.mobile-push-90 {
left: 90%;
}
.mobile-pull-90 {
left: -90%;
}
.mobile-grid-95 {
float: left;
width: 95%;
}
.mobile-prefix-95 {
margin-left: 95%;
}
.mobile-suffix-95 {
margin-right: 95%;
}
.mobile-push-95 {
left: 95%;
}
.mobile-pull-95 {
left: -95%;
}
.mobile-grid-33 {
float: left;
width: 33.33333%;
}
.mobile-prefix-33 {
margin-left: 33.33333%;
}
.mobile-suffix-33 {
margin-right: 33.33333%;
}
.mobile-push-33 {
left: 33.33333%;
}
.mobile-pull-33 {
left: -33.33333%;
}
.mobile-grid-66 {
float: left;
width: 66.66667%;
}
.mobile-prefix-66 {
margin-left: 66.66667%;
}
.mobile-suffix-66 {
margin-right: 66.66667%;
}
.mobile-push-66 {
left: 66.66667%;
}
.mobile-pull-66 {
left: -66.66667%;
}
.mobile-grid-100 {
clear: both;
width: 100%;
}
}
@media screen and (min-width: 768px) {
.grid-100:before,
.grid-100:after {
content: ".";
display: block;
overflow: hidden;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.grid-100:after {
clear: both;
}
.push-5, .pull-5, .push-10, .pull-10, .push-15, .pull-15, .push-20, .pull-20, .push-25, .pull-25, .push-30, .pull-30, .push-35, .pull-35, .push-40, .pull-40, .push-45, .pull-45, .push-50, .pull-50, .push-55, .pull-55, .push-60, .pull-60, .push-65, .pull-65, .push-70, .pull-70, .push-75, .pull-75, .push-80, .pull-80, .push-85, .pull-85, .push-90, .pull-90, .push-95, .pull-95, .push-33, .pull-33, .push-66, .pull-66 {
position: relative;
}
.hide-on-desktop {
display: none !important;
}
.grid-5 {
float: left;
width: 5%;
}
.prefix-5 {
margin-left: 5%;
}
.suffix-5 {
margin-right: 5%;
}
.push-5 {
left: 5%;
}
.pull-5 {
left: -5%;
}
.grid-10 {
float: left;
width: 10%;
}
.prefix-10 {
margin-left: 10%;
}
.suffix-10 {
margin-right: 10%;
}
.push-10 {
left: 10%;
}
.pull-10 {
left: -10%;
}
.grid-15 {
float: left;
width: 15%;
}
.prefix-15 {
margin-left: 15%;
}
.suffix-15 {
margin-right: 15%;
}
.push-15 {
left: 15%;
}
.pull-15 {
left: -15%;
}
.grid-20 {
float: left;
width: 20%;
}
.prefix-20 {
margin-left: 20%;
}
.suffix-20 {
margin-right: 20%;
}
.push-20 {
left: 20%;
}
.pull-20 {
left: -20%;
}
.grid-25 {
float: left;
width: 25%;
}
.prefix-25 {
margin-left: 25%;
}
.suffix-25 {
margin-right: 25%;
}
.push-25 {
left: 25%;
}
.pull-25 {
left: -25%;
}
.grid-30 {
float: left;
width: 30%;
}
.prefix-30 {
margin-left: 30%;
}
.suffix-30 {
margin-right: 30%;
}
.push-30 {
left: 30%;
}
.pull-30 {
left: -30%;
}
.grid-35 {
float: left;
width: 35%;
}
.prefix-35 {
margin-left: 35%;
}
.suffix-35 {
margin-right: 35%;
}
.push-35 {
left: 35%;
}
.pull-35 {
left: -35%;
}
.grid-40 {
float: left;
width: 40%;
}
.prefix-40 {
margin-left: 40%;
}
.suffix-40 {
margin-right: 40%;
}
.push-40 {
left: 40%;
}
.pull-40 {
left: -40%;
}
.grid-45 {
float: left;
width: 45%;
}
.prefix-45 {
margin-left: 45%;
}
.suffix-45 {
margin-right: 45%;
}
.push-45 {
left: 45%;
}
.pull-45 {
left: -45%;
}
.grid-50 {
float: left;
width: 50%;
}
.prefix-50 {
margin-left: 50%;
}
.suffix-50 {
margin-right: 50%;
}
.push-50 {
left: 50%;
}
.pull-50 {
left: -50%;
}
.grid-55 {
float: left;
width: 55%;
}
.prefix-55 {
margin-left: 55%;
}
.suffix-55 {
margin-right: 55%;
}
.push-55 {
left: 55%;
}
.pull-55 {
left: -55%;
}
.grid-60 {
float: left;
width: 60%;
}
.prefix-60 {
margin-left: 60%;
}
.suffix-60 {
margin-right: 60%;
}
.push-60 {
left: 60%;
}
.pull-60 {
left: -60%;
}
.grid-65 {
float: left;
width: 65%;
}
.prefix-65 {
margin-left: 65%;
}
.suffix-65 {
margin-right: 65%;
}
.push-65 {
left: 65%;
}
.pull-65 {
left: -65%;
}
.grid-70 {
float: left;
width: 70%;
}
.prefix-70 {
margin-left: 70%;
}
.suffix-70 {
margin-right: 70%;
}
.push-70 {
left: 70%;
}
.pull-70 {
left: -70%;
}
.grid-75 {
float: left;
width: 75%;
}
.prefix-75 {
margin-left: 75%;
}
.suffix-75 {
margin-right: 75%;
}
.push-75 {
left: 75%;
}
.pull-75 {
left: -75%;
}
.grid-80 {
float: left;
width: 80%;
}
.prefix-80 {
margin-left: 80%;
}
.suffix-80 {
margin-right: 80%;
}
.push-80 {
left: 80%;
}
.pull-80 {
left: -80%;
}
.grid-85 {
float: left;
width: 85%;
}
.prefix-85 {
margin-left: 85%;
}
.suffix-85 {
margin-right: 85%;
}
.push-85 {
left: 85%;
}
.pull-85 {
left: -85%;
}
.grid-90 {
float: left;
width: 90%;
}
.prefix-90 {
margin-left: 90%;
}
.suffix-90 {
margin-right: 90%;
}
.push-90 {
left: 90%;
}
.pull-90 {
left: -90%;
}
.grid-95 {
float: left;
width: 95%;
}
.prefix-95 {
margin-left: 95%;
}
.suffix-95 {
margin-right: 95%;
}
.push-95 {
left: 95%;
}
.pull-95 {
left: -95%;
}
.grid-33 {
float: left;
width: 33.33333%;
}
.prefix-33 {
margin-left: 33.33333%;
}
.suffix-33 {
margin-right: 33.33333%;
}
.push-33 {
left: 33.33333%;
}
.pull-33 {
left: -33.33333%;
}
.grid-66 {
float: left;
width: 66.66667%;
}
.prefix-66 {
margin-left: 66.66667%;
}
.suffix-66 {
margin-right: 66.66667%;
}
.push-66 {
left: 66.66667%;
}
.pull-66 {
left: -66.66667%;
}
.grid-100 {
clear: both;
width: 100%;
}
}
Using Papa Parser to turn the output from web scrapper to an object.
Its just simple code but it worked for me ;)
/*!
Papa Parse
v4.1.1
https://github.com/mholt/PapaParse
*/
(function(global)
{
"use strict";
var IS_WORKER = (!global.document && !!global.postMessage), LOADED_SYNC = false, AUTO_SCRIPT_PATH;
var workers = {}, workerIdCounter = 0;
var Papa = {};
Papa.parse = CsvToJson;
Papa.unparse = JsonToCsv;
Papa.RECORD_SEP = String.fromCharCode(30);
Papa.UNIT_SEP = String.fromCharCode(31);
Papa.BYTE_ORDER_MARK = "\ufeff";
Papa.BAD_DELIMITERS = ["\r", "\n", "\"", Papa.BYTE_ORDER_MARK];
Papa.WORKERS_SUPPORTED = !!global.Worker;
Papa.SCRIPT_PATH = null; // Must be set by your code if you use workers and this lib is loaded asynchronously
// Configurable chunk sizes for local and remote files, respectively
Papa.LocalChunkSize = 1024 * 1024 * 10; // 10 MB
Papa.RemoteChunkSize = 1024 * 1024 * 5; // 5 MB
Papa.DefaultDelimiter = ","; // Used if not specified and detection fails
// Exposed for testing and development only
Papa.Parser = Parser;
Papa.ParserHandle = ParserHandle;
Papa.NetworkStreamer = NetworkStreamer;
Papa.FileStreamer = FileStreamer;
Papa.StringStreamer = StringStreamer;
if (typeof module !== 'undefined' && module.exports)
{
// Export to Node...
module.exports = Papa;
}
else if (isFunction(global.define) && global.define.amd)
{
// Wireup with RequireJS
define(function() { return Papa; });
}
else
{
// ...or as browser global
global.Papa = Papa;
}
if (global.jQuery)
{
var $ = global.jQuery;
$.fn.parse = function(options)
{
var config = options.config || {};
var queue = [];
this.each(function(idx)
{
var supported = $(this).prop('tagName').toUpperCase() == "INPUT"
&& $(this).attr('type').toLowerCase() == "file"
&& global.FileReader;
if (!supported || !this.files || this.files.length == 0)
return true; // continue to next input element
for (var i = 0; i < this.files.length; i++)
{
queue.push({
file: this.files[i],
inputElem: this,
instanceConfig: $.extend({}, config)
});
}
});
parseNextFile(); // begin parsing
return this; // maintains chainability
function parseNextFile()
{
if (queue.length == 0)
{
if (isFunction(options.complete))
options.complete();
return;
}
var f = queue[0];
if (isFunction(options.before))
{
var returned = options.before(f.file, f.inputElem);
if (typeof returned === 'object')
{
if (returned.action == "abort")
{
error("AbortError", f.file, f.inputElem, returned.reason);
return; // Aborts all queued files immediately
}
else if (returned.action == "skip")
{
fileComplete(); // parse the next file in the queue, if any
return;
}
else if (typeof returned.config === 'object')
f.instanceConfig = $.extend(f.instanceConfig, returned.config);
}
else if (returned == "skip")
{
fileComplete(); // parse the next file in the queue, if any
return;
}
}
// Wrap up the user's complete callback, if any, so that ours also gets executed
var userCompleteFunc = f.instanceConfig.complete;
f.instanceConfig.complete = function(results)
{
if (isFunction(userCompleteFunc))
userCompleteFunc(results, f.file, f.inputElem);
fileComplete();
};
Papa.parse(f.file, f.instanceConfig);
}
function error(name, file, elem, reason)
{
if (isFunction(options.error))
options.error({name: name}, file, elem, reason);
}
function fileComplete()
{
queue.splice(0, 1);
parseNextFile();
}
}
}
if (IS_WORKER)
{
global.onmessage = workerThreadReceivedMessage;
}
else if (Papa.WORKERS_SUPPORTED)
{
AUTO_SCRIPT_PATH = getScriptPath();
// Check if the script was loaded synchronously
if (!document.body)
{
// Body doesn't exist yet, must be synchronous
LOADED_SYNC = true;
}
else
{
document.addEventListener('DOMContentLoaded', function () {
LOADED_SYNC = true;
}, true);
}
}
function CsvToJson(_input, _config)
{
_config = _config || {};
if (_config.worker && Papa.WORKERS_SUPPORTED)
{
var w = newWorker();
w.userStep = _config.step;
w.userChunk = _config.chunk;
w.userComplete = _config.complete;
w.userError = _config.error;
_config.step = isFunction(_config.step);
_config.chunk = isFunction(_config.chunk);
_config.complete = isFunction(_config.complete);
_config.error = isFunction(_config.error);
delete _config.worker; // prevent infinite loop
w.postMessage({
input: _input,
config: _config,
workerId: w.id
});
return;
}
var streamer = null;
if (typeof _input === 'string')
{
if (_config.download)
streamer = new NetworkStreamer(_config);
else
streamer = new StringStreamer(_config);
}
else if ((global.File && _input instanceof File) || _input instanceof Object) // ...Safari. (see issue #106)
streamer = new FileStreamer(_config);
return streamer.stream(_input);
}
function JsonToCsv(_input, _config)
{
var _output = "";
var _fields = [];
// Default configuration
var _quotes = false; // whether to surround every datum with quotes
var _delimiter = ","; // delimiting character
var _newline = "\r\n"; // newline character(s)
unpackConfig();
if (typeof _input === 'string')
_input = JSON.parse(_input);
if (_input instanceof Array)
{
if (!_input.length || _input[0] instanceof Array)
return serialize(null, _input);
else if (typeof _input[0] === 'object')
return serialize(objectKeys(_input[0]), _input);
}
else if (typeof _input === 'object')
{
if (typeof _input.data === 'string')
_input.data = JSON.parse(_input.data);
if (_input.data instanceof Array)
{
if (!_input.fields)
_input.fields = _input.data[0] instanceof Array
? _input.fields
: objectKeys(_input.data[0]);
if (!(_input.data[0] instanceof Array) && typeof _input.data[0] !== 'object')
_input.data = [_input.data]; // handles input like [1,2,3] or ["asdf"]
}
return serialize(_input.fields || [], _input.data || []);
}
// Default (any valid paths should return before this)
throw "exception: Unable to serialize unrecognized input";
function unpackConfig()
{
if (typeof _config !== 'object')
return;
if (typeof _config.delimiter === 'string'
&& _config.delimiter.length == 1
&& Papa.BAD_DELIMITERS.indexOf(_config.delimiter) == -1)
{
_delimiter = _config.delimiter;
}
if (typeof _config.quotes === 'boolean'
|| _config.quotes instanceof Array)
_quotes = _config.quotes;
if (typeof _config.newline === 'string')
_newline = _config.newline;
}
// Turns an object's keys into an array
function objectKeys(obj)
{
if (typeof obj !== 'object')
return [];
var keys = [];
for (var key in obj)
keys.push(key);
return keys;
}
// The double for loop that iterates the data and writes out a CSV string including header row
function serialize(fields, data)
{
var csv = "";
if (typeof fields === 'string')
fields = JSON.parse(fields);
if (typeof data === 'string')
data = JSON.parse(data);
var hasHeader = fields instanceof Array && fields.length > 0;
var dataKeyedByField = !(data[0] instanceof Array);
// If there a header row, write it first
if (hasHeader)
{
for (var i = 0; i < fields.length; i++)
{
if (i > 0)
csv += _delimiter;
csv += safe(fields[i], i);
}
if (data.length > 0)
csv += _newline;
}
// Then write out the data
for (var row = 0; row < data.length; row++)
{
var maxCol = hasHeader ? fields.length : data[row].length;
for (var col = 0; col < maxCol; col++)
{
if (col > 0)
csv += _delimiter;
var colIdx = hasHeader && dataKeyedByField ? fields[col] : col;
csv += safe(data[row][colIdx], col);
}
if (row < data.length - 1)
csv += _newline;
}
return csv;
}
// Encloses a value around quotes if needed (makes a value safe for CSV insertion)
function safe(str, col)
{
if (typeof str === "undefined" || str === null)
return "";
str = str.toString().replace(/"/g, '""');
var needsQuotes = (typeof _quotes === 'boolean' && _quotes)
|| (_quotes instanceof Array && _quotes[col])
|| hasAny(str, Papa.BAD_DELIMITERS)
|| str.indexOf(_delimiter) > -1
|| str.charAt(0) == ' '
|| str.charAt(str.length - 1) == ' ';
return needsQuotes ? '"' + str + '"' : str;
}
function hasAny(str, substrings)
{
for (var i = 0; i < substrings.length; i++)
if (str.indexOf(substrings[i]) > -1)
return true;
return false;
}
}
// ChunkStreamer is the base prototype for various streamer implementations.
function ChunkStreamer(config)
{
this._handle = null;
this._paused = false;
this._finished = false;
this._input = null;
this._baseIndex = 0;
this._partialLine = "";
this._rowCount = 0;
this._start = 0;
this._nextChunk = null;
this.isFirstChunk = true;
this._completeResults = {
data: [],
errors: [],
meta: {}
};
replaceConfig.call(this, config);
this.parseChunk = function(chunk)
{
// First chunk pre-processing
if (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))
{
var modifiedChunk = this._config.beforeFirstChunk(chunk);
if (modifiedChunk !== undefined)
chunk = modifiedChunk;
}
this.isFirstChunk = false;
// Rejoin the line we likely just split in two by chunking the file
var aggregate = this._partialLine + chunk;
this._partialLine = "";
var results = this._handle.parse(aggregate, this._baseIndex, !this._finished);
if (this._handle.paused() || this._handle.aborted())
return;
var lastIndex = results.meta.cursor;
if (!this._finished)
{
this._partialLine = aggregate.substring(lastIndex - this._baseIndex);
this._baseIndex = lastIndex;
}
if (results && results.data)
this._rowCount += results.data.length;
var finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);
if (IS_WORKER)
{
global.postMessage({
results: results,
workerId: Papa.WORKER_ID,
finished: finishedIncludingPreview
});
}
else if (isFunction(this._config.chunk))
{
this._config.chunk(results, this._handle);
if (this._paused)
return;
results = undefined;
this._completeResults = undefined;
}
if (!this._config.step && !this._config.chunk) {
this._completeResults.data = this._completeResults.data.concat(results.data);
this._completeResults.errors = this._completeResults.errors.concat(results.errors);
this._completeResults.meta = results.meta;
}
if (finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted))
this._config.complete(this._completeResults);
if (!finishedIncludingPreview && (!results || !results.meta.paused))
this._nextChunk();
return results;
};
this._sendError = function(error)
{
if (isFunction(this._config.error))
this._config.error(error);
else if (IS_WORKER && this._config.error)
{
global.postMessage({
workerId: Papa.WORKER_ID,
error: error,
finished: false
});
}
};
function replaceConfig(config)
{
// Deep-copy the config so we can edit it
var configCopy = copy(config);
configCopy.chunkSize = parseInt(configCopy.chunkSize); // parseInt VERY important so we don't concatenate strings!
if (!config.step && !config.chunk)
configCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196
this._handle = new ParserHandle(configCopy);
this._handle.streamer = this;
this._config = configCopy; // persist the copy to the caller
}
}
function NetworkStreamer(config)
{
config = config || {};
if (!config.chunkSize)
config.chunkSize = Papa.RemoteChunkSize;
ChunkStreamer.call(this, config);
var xhr;
if (IS_WORKER)
{
this._nextChunk = function()
{
this._readChunk();
this._chunkLoaded();
};
}
else
{
this._nextChunk = function()
{
this._readChunk();
};
}
this.stream = function(url)
{
this._input = url;
this._nextChunk(); // Starts streaming
};
this._readChunk = function()
{
if (this._finished)
{
this._chunkLoaded();
return;
}
xhr = new XMLHttpRequest();
if (!IS_WORKER)
{
xhr.onload = bindFunction(this._chunkLoaded, this);
xhr.onerror = bindFunction(this._chunkError, this);
}
xhr.open("GET", this._input, !IS_WORKER);
if (this._config.chunkSize)
{
var end = this._start + this._config.chunkSize - 1; // minus one because byte range is inclusive
xhr.setRequestHeader("Range", "bytes="+this._start+"-"+end);
xhr.setRequestHeader("If-None-Match", "webkit-no-cache"); // https://bugs.webkit.org/show_bug.cgi?id=82672
}
try {
xhr.send();
}
catch (err) {
this._chunkError(err.message);
}
if (IS_WORKER && xhr.status == 0)
this._chunkError();
else
this._start += this._config.chunkSize;
}
this._chunkLoaded = function()
{
if (xhr.readyState != 4)
return;
if (xhr.status < 200 || xhr.status >= 400)
{
this._chunkError();
return;
}
this._finished = !this._config.chunkSize || this._start > getFileSize(xhr);
this.parseChunk(xhr.responseText);
}
this._chunkError = function(errorMessage)
{
var errorText = xhr.statusText || errorMessage;
this._sendError(errorText);
}
function getFileSize(xhr)
{
var contentRange = xhr.getResponseHeader("Content-Range");
return parseInt(contentRange.substr(contentRange.lastIndexOf("/") + 1));
}
}
NetworkStreamer.prototype = Object.create(ChunkStreamer.prototype);
NetworkStreamer.prototype.constructor = NetworkStreamer;
function FileStreamer(config)
{
config = config || {};
if (!config.chunkSize)
config.chunkSize = Papa.LocalChunkSize;
ChunkStreamer.call(this, config);
var reader, slice;
// FileReader is better than FileReaderSync (even in worker) - see http://stackoverflow.com/q/24708649/1048862
// But Firefox is a pill, too - see issue #76: https://github.com/mholt/PapaParse/issues/76
var usingAsyncReader = typeof FileReader !== 'undefined'; // Safari doesn't consider it a function - see issue #105
this.stream = function(file)
{
this._input = file;
slice = file.slice || file.webkitSlice || file.mozSlice;
if (usingAsyncReader)
{
reader = new FileReader(); // Preferred method of reading files, even in workers
reader.onload = bindFunction(this._chunkLoaded, this);
reader.onerror = bindFunction(this._chunkError, this);
}
else
reader = new FileReaderSync(); // Hack for running in a web worker in Firefox
this._nextChunk(); // Starts streaming
};
this._nextChunk = function()
{
if (!this._finished && (!this._config.preview || this._rowCount < this._config.preview))
this._readChunk();
}
this._readChunk = function()
{
var input = this._input;
if (this._config.chunkSize)
{
var end = Math.min(this._start + this._config.chunkSize, this._input.size);
input = slice.call(input, this._start, end);
}
var txt = reader.readAsText(input, this._config.encoding);
if (!usingAsyncReader)
this._chunkLoaded({ target: { result: txt } }); // mimic the async signature
}
this._chunkLoaded = function(event)
{
// Very important to increment start each time before handling results
this._start += this._config.chunkSize;
this._finished = !this._config.chunkSize || this._start >= this._input.size;
this.parseChunk(event.target.result);
}
this._chunkError = function()
{
this._sendError(reader.error);
}
}
FileStreamer.prototype = Object.create(ChunkStreamer.prototype);
FileStreamer.prototype.constructor = FileStreamer;
function StringStreamer(config)
{
config = config || {};
ChunkStreamer.call(this, config);
var string;
var remaining;
this.stream = function(s)
{
string = s;
remaining = s;
return this._nextChunk();
}
this._nextChunk = function()
{
if (this._finished) return;
var size = this._config.chunkSize;
var chunk = size ? remaining.substr(0, size) : remaining;
remaining = size ? remaining.substr(size) : '';
this._finished = !remaining;
return this.parseChunk(chunk);
}
}
StringStreamer.prototype = Object.create(StringStreamer.prototype);
StringStreamer.prototype.constructor = StringStreamer;
// Use one ParserHandle per entire CSV file or string
function ParserHandle(_config)
{
// One goal is to minimize the use of regular expressions...
var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;
var self = this;
var _stepCounter = 0; // Number of times step was called (number of rows parsed)
var _input; // The input being parsed
var _parser; // The core parser being used
var _paused = false; // Whether we are paused or not
var _aborted = false; // Whether the parser has aborted or not
var _delimiterError; // Temporary state between delimiter detection and processing results
var _fields = []; // Fields are from the header row of the input, if there is one
var _results = { // The last results returned from the parser
data: [],
errors: [],
meta: {}
};
if (isFunction(_config.step))
{
var userStep = _config.step;
_config.step = function(results)
{
_results = results;
if (needsHeaderRow())
processResults();
else // only call user's step function after header row
{
processResults();
// It's possbile that this line was empty and there's no row here after all
if (_results.data.length == 0)
return;
_stepCounter += results.data.length;
if (_config.preview && _stepCounter > _config.preview)
_parser.abort();
else
userStep(_results, self);
}
};
}
// Parses input. Most users won't need, and shouldn't mess with, the baseIndex
// and ignoreLastRow parameters. They are used by streamers (wrapper functions)
// when an input comes in multiple chunks, like from a file.
this.parse = function(input, baseIndex, ignoreLastRow)
{
if (!_config.newline)
_config.newline = guessLineEndings(input);
_delimiterError = false;
if (!_config.delimiter)
{
var delimGuess = guessDelimiter(input);
if (delimGuess.successful)
_config.delimiter = delimGuess.bestDelimiter;
else
{
_delimiterError = true; // add error after parsing (otherwise it would be overwritten)
_config.delimiter = Papa.DefaultDelimiter;
}
_results.meta.delimiter = _config.delimiter;
}
var parserConfig = copy(_config);
if (_config.preview && _config.header)
parserConfig.preview++; // to compensate for header row
_input = input;
_parser = new Parser(parserConfig);
_results = _parser.parse(_input, baseIndex, ignoreLastRow);
processResults();
return _paused ? { meta: { paused: true } } : (_results || { meta: { paused: false } });
};
this.paused = function()
{
return _paused;
};
this.pause = function()
{
_paused = true;
_parser.abort();
_input = _input.substr(_parser.getCharIndex());
};
this.resume = function()
{
_paused = false;
self.streamer.parseChunk(_input);
};
this.aborted = function () {
return _aborted;
}
this.abort = function()
{
_aborted = true;
_parser.abort();
_results.meta.aborted = true;
if (isFunction(_config.complete))
_config.complete(_results);
_input = "";
};
function processResults()
{
if (_results && _delimiterError)
{
addError("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '"+Papa.DefaultDelimiter+"'");
_delimiterError = false;
}
if (_config.skipEmptyLines)
{
for (var i = 0; i < _results.data.length; i++)
if (_results.data[i].length == 1 && _results.data[i][0] == "")
_results.data.splice(i--, 1);
}
if (needsHeaderRow())
fillHeaderFields();
return applyHeaderAndDynamicTyping();
}
function needsHeaderRow()
{
return _config.header && _fields.length == 0;
}
function fillHeaderFields()
{
if (!_results)
return;
for (var i = 0; needsHeaderRow() && i < _results.data.length; i++)
for (var j = 0; j < _results.data[i].length; j++)
_fields.push(_results.data[i][j]);
_results.data.splice(0, 1);
}
function applyHeaderAndDynamicTyping()
{
if (!_results || (!_config.header && !_config.dynamicTyping))
return _results;
for (var i = 0; i < _results.data.length; i++)
{
var row = {};
for (var j = 0; j < _results.data[i].length; j++)
{
if (_config.dynamicTyping)
{
var value = _results.data[i][j];
if (value == "true" || value == "TRUE")
_results.data[i][j] = true;
else if (value == "false" || value == "FALSE")
_results.data[i][j] = false;
else
_results.data[i][j] = tryParseFloat(value);
}
if (_config.header)
{
if (j >= _fields.length)
{
if (!row["__parsed_extra"])
row["__parsed_extra"] = [];
row["__parsed_extra"].push(_results.data[i][j]);
}
else
row[_fields[j]] = _results.data[i][j];
}
}
if (_config.header)
{
_results.data[i] = row;
if (j > _fields.length)
addError("FieldMismatch", "TooManyFields", "Too many fields: expected " + _fields.length + " fields but parsed " + j, i);
else if (j < _fields.length)
addError("FieldMismatch", "TooFewFields", "Too few fields: expected " + _fields.length + " fields but parsed " + j, i);
}
}
if (_config.header && _results.meta)
_results.meta.fields = _fields;
return _results;
}
function guessDelimiter(input)
{
var delimChoices = [",", "\t", "|", ";", Papa.RECORD_SEP, Papa.UNIT_SEP];
var bestDelim, bestDelta, fieldCountPrevRow;
for (var i = 0; i < delimChoices.length; i++)
{
var delim = delimChoices[i];
var delta = 0, avgFieldCount = 0;
fieldCountPrevRow = undefined;
var preview = new Parser({
delimiter: delim,
preview: 10
}).parse(input);
for (var j = 0; j < preview.data.length; j++)
{
var fieldCount = preview.data[j].length;
avgFieldCount += fieldCount;
if (typeof fieldCountPrevRow === 'undefined')
{
fieldCountPrevRow = fieldCount;
continue;
}
else if (fieldCount > 1)
{
delta += Math.abs(fieldCount - fieldCountPrevRow);
fieldCountPrevRow = fieldCount;
}
}
avgFieldCount /= preview.data.length;
if ((typeof bestDelta === 'undefined' || delta < bestDelta)
&& avgFieldCount > 1.99)
{
bestDelta = delta;
bestDelim = delim;
}
}
_config.delimiter = bestDelim;
return {
successful: !!bestDelim,
bestDelimiter: bestDelim
}
}
function guessLineEndings(input)
{
input = input.substr(0, 1024*1024); // max length 1 MB
var r = input.split('\r');
if (r.length == 1)
return '\n';
var numWithN = 0;
for (var i = 0; i < r.length; i++)
{
if (r[i][0] == '\n')
numWithN++;
}
return numWithN >= r.length / 2 ? '\r\n' : '\r';
}
function tryParseFloat(val)
{
var isNumber = FLOAT.test(val);
return isNumber ? parseFloat(val) : val;
}
function addError(type, code, msg, row)
{
_results.errors.push({
type: type,
code: code,
message: msg,
row: row
});
}
}
// The core parser implements speedy and correct CSV parsing
function Parser(config)
{
// Unpack the config object
config = config || {};
var delim = config.delimiter;
var newline = config.newline;
var comments = config.comments;
var step = config.step;
var preview = config.preview;
var fastMode = config.fastMode;
// Delimiter must be valid
if (typeof delim !== 'string'
|| Papa.BAD_DELIMITERS.indexOf(delim) > -1)
delim = ",";
// Comment character must be valid
if (comments === delim)
throw "Comment character same as delimiter";
else if (comments === true)
comments = "#";
else if (typeof comments !== 'string'
|| Papa.BAD_DELIMITERS.indexOf(comments) > -1)
comments = false;
// Newline must be valid: \r, \n, or \r\n
if (newline != '\n' && newline != '\r' && newline != '\r\n')
newline = '\n';
// We're gonna need these at the Parser scope
var cursor = 0;
var aborted = false;
this.parse = function(input, baseIndex, ignoreLastRow)
{
// For some reason, in Chrome, this speeds things up (!?)
if (typeof input !== 'string')
throw "Input must be a string";
// We don't need to compute some of these every time parse() is called,
// but having them in a more local scope seems to perform better
var inputLen = input.length,
delimLen = delim.length,
newlineLen = newline.length,
commentsLen = comments.length;
var stepIsFunction = typeof step === 'function';
// Establish starting state
cursor = 0;
var data = [], errors = [], row = [], lastCursor = 0;
if (!input)
return returnable();
if (fastMode || (fastMode !== false && input.indexOf('"') === -1))
{
var rows = input.split(newline);
for (var i = 0; i < rows.length; i++)
{
var row = rows[i];
cursor += row.length;
if (i !== rows.length - 1)
cursor += newline.length;
else if (ignoreLastRow)
return returnable();
if (comments && row.substr(0, commentsLen) == comments)
continue;
if (stepIsFunction)
{
data = [];
pushRow(row.split(delim));
doStep();
if (aborted)
return returnable();
}
else
pushRow(row.split(delim));
if (preview && i >= preview)
{
data = data.slice(0, preview);
return returnable(true);
}
}
return returnable();
}
var nextDelim = input.indexOf(delim, cursor);
var nextNewline = input.indexOf(newline, cursor);
// Parser loop
for (;;)
{
// Field has opening quote
if (input[cursor] == '"')
{
// Start our search for the closing quote where the cursor is
var quoteSearch = cursor;
// Skip the opening quote
cursor++;
for (;;)
{
// Find closing quote
var quoteSearch = input.indexOf('"', quoteSearch+1);
if (quoteSearch === -1)
{
if (!ignoreLastRow) {
// No closing quote... what a pity
errors.push({
type: "Quotes",
code: "MissingQuotes",
message: "Quoted field unterminated",
row: data.length, // row has yet to be inserted
index: cursor
});
}
return finish();
}
if (quoteSearch === inputLen-1)
{
// Closing quote at EOF
var value = input.substring(cursor, quoteSearch).replace(/""/g, '"');
return finish(value);
}
// If this quote is escaped, it's part of the data; skip it
if (input[quoteSearch+1] == '"')
{
quoteSearch++;
continue;
}
if (input[quoteSearch+1] == delim)
{
// Closing quote followed by delimiter
row.push(input.substring(cursor, quoteSearch).replace(/""/g, '"'));
cursor = quoteSearch + 1 + delimLen;
nextDelim = input.indexOf(delim, cursor);
nextNewline = input.indexOf(newline, cursor);
break;
}
if (input.substr(quoteSearch+1, newlineLen) === newline)
{
// Closing quote followed by newline
row.push(input.substring(cursor, quoteSearch).replace(/""/g, '"'));
saveRow(quoteSearch + 1 + newlineLen);
nextDelim = input.indexOf(delim, cursor); // because we may have skipped the nextDelim in the quoted field
if (stepIsFunction)
{
doStep();
if (aborted)
return returnable();
}
if (preview && data.length >= preview)
return returnable(true);
break;
}
}
continue;
}
// Comment found at start of new line
if (comments && row.length === 0 && input.substr(cursor, commentsLen) === comments)
{
if (nextNewline == -1) // Comment ends at EOF
return returnable();
cursor = nextNewline + newlineLen;
nextNewline = input.indexOf(newline, cursor);
nextDelim = input.indexOf(delim, cursor);
continue;
}
// Next delimiter comes before next newline, so we've reached end of field
if (nextDelim !== -1 && (nextDelim < nextNewline || nextNewline === -1))
{
row.push(input.substring(cursor, nextDelim));
cursor = nextDelim + delimLen;
nextDelim = input.indexOf(delim, cursor);
continue;
}
// End of row
if (nextNewline !== -1)
{
row.push(input.substring(cursor, nextNewline));
saveRow(nextNewline + newlineLen);
if (stepIsFunction)
{
doStep();
if (aborted)
return returnable();
}
if (preview && data.length >= preview)
return returnable(true);
continue;
}
break;
}
return finish();
function pushRow(row)
{
data.push(row);
lastCursor = cursor;
}
// Appends the remaining input from cursor to the end into
// row, saves the row, calls step, and returns the results.
function finish(value)
{
if (ignoreLastRow)
return returnable();
if (!value)
value = input.substr(cursor);
row.push(value);
cursor = inputLen; // important in case parsing is paused
pushRow(row);
if (stepIsFunction)
doStep();
return returnable();
}
// Appends the current row to the results. It sets the cursor
// to newCursor and finds the nextNewline. The caller should
// take care to execute user's step function and check for
// preview and end parsing if necessary.
function saveRow(newCursor)
{
cursor = newCursor;
pushRow(row);
row = [];
nextNewline = input.indexOf(newline, cursor);
}
// Returns an object with the results, errors, and meta.
function returnable(stopped)
{
return {
data: data,
errors: errors,
meta: {
delimiter: delim,
linebreak: newline,
aborted: aborted,
truncated: !!stopped,
cursor: lastCursor + (baseIndex || 0)
}
};
}
// Executes the user's step function and resets data & errors.
function doStep()
{
step(returnable());
data = [], errors = [];
}
};
// Sets the abort flag
this.abort = function()
{
aborted = true;
};
// Gets the cursor position
this.getCharIndex = function()
{
return cursor;
};
}
// If you need to load Papa Parse asynchronously and you also need worker threads, hard-code
// the script path here. See: https://github.com/mholt/PapaParse/issues/87#issuecomment-57885358
function getScriptPath()
{
var scripts = document.getElementsByTagName('script');
return scripts.length ? scripts[scripts.length - 1].src : '';
}
function newWorker()
{
if (!Papa.WORKERS_SUPPORTED)
return false;
if (!LOADED_SYNC && Papa.SCRIPT_PATH === null)
throw new Error(
'Script path cannot be determined automatically when Papa Parse is loaded asynchronously. ' +
'You need to set Papa.SCRIPT_PATH manually.'
);
var w = new global.Worker(Papa.SCRIPT_PATH || AUTO_SCRIPT_PATH);
w.onmessage = mainThreadReceivedMessage;
w.id = workerIdCounter++;
workers[w.id] = w;
return w;
}
// Callback when main thread receives a message
function mainThreadReceivedMessage(e)
{
var msg = e.data;
var worker = workers[msg.workerId];
var aborted = false;
if (msg.error)
worker.userError(msg.error, msg.file);
else if (msg.results && msg.results.data)
{
var abort = function() {
aborted = true;
completeWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });
};
var handle = {
abort: abort,
pause: notImplemented,
resume: notImplemented
};
if (isFunction(worker.userStep))
{
for (var i = 0; i < msg.results.data.length; i++)
{
worker.userStep({
data: [msg.results.data[i]],
errors: msg.results.errors,
meta: msg.results.meta
}, handle);
if (aborted)
break;
}
delete msg.results; // free memory ASAP
}
else if (isFunction(worker.userChunk))
{
worker.userChunk(msg.results, handle, msg.file);
delete msg.results;
}
}
if (msg.finished && !aborted)
completeWorker(msg.workerId, msg.results);
}
function completeWorker(workerId, results) {
var worker = workers[workerId];
if (isFunction(worker.userComplete))
worker.userComplete(results);
worker.terminate();
delete workers[workerId];
}
function notImplemented() {
throw "Not implemented.";
}
// Callback when worker thread receives a message
function workerThreadReceivedMessage(e)
{
var msg = e.data;
if (typeof Papa.WORKER_ID === 'undefined' && msg)
Papa.WORKER_ID = msg.workerId;
if (typeof msg.input === 'string')
{
global.postMessage({
workerId: Papa.WORKER_ID,
results: Papa.parse(msg.input, msg.config),
finished: true
});
}
else if ((global.File && msg.input instanceof File) || msg.input instanceof Object) // thank you, Safari (see issue #106)
{
var results = Papa.parse(msg.input, msg.config);
if (results)
global.postMessage({
workerId: Papa.WORKER_ID,
results: results,
finished: true
});
}
}
// Makes a deep copy of an array or object (mostly)
function copy(obj)
{
if (typeof obj !== 'object')
return obj;
var cpy = obj instanceof Array ? [] : {};
for (var key in obj)
cpy[key] = copy(obj[key]);
return cpy;
}
function bindFunction(f, self)
{
return function() { f.apply(self, arguments); };
}
function isFunction(func)
{
return typeof func === 'function';
}
})(typeof window !== 'undefined' ? window : this);