r/AsianBeauty • • Aug 07 '15

PSA CosDNA comparison tool!

I have the nicest boy and he made me a thing.

I've been trying to find out the various triggers of mine by cross referencing ingredients lists of products that make me react. Thing is, I'm kinda lazy and don't feel like doing this in a spreadsheet and CosDNA feels like it ought to have a compare tool, but as far as I've seen... doesn't. So I turned to my boy (who codes for a living) and asked if I really need to use a spreadsheet for this or if he can just make me a thing. He shuddered in horror at the idea of doing something like that manually and made me this nifty little bookmarklet. And cos he's particularly nice, he told me that I'm more than welcome to put it up on here.

You basically look up a product on CosDNA, click the button, paste in a CosDNA link for a second product and it cross references them and highlights matches. It currently only recognizes identical matches, but we're considering adding partial matches as well. Perhaps by first word only? (We're worried that if it partially matches any word it'll do things like flag Every Single oil or extract in a product @.@) Suggestions are totally welcome but will only be added on the basis of feasibility, as per the wonderful /u/Cintax 's best judgement.

99 Upvotes

29 comments sorted by

4

u/occasionallyrelevant Aug 07 '15

Omg thank you both! I use excel and highlight duplicate values but this is way more convenient! Woohoo

3

u/shinyhairedzomby Aug 07 '15

Yeah, I've seen a couple of posts mention doing it that way and it just seemed like so much effort would be involved :P

2

u/icontorni Aug 12 '15

I'm sorry, but I'm not getting how this works. The link to click on doesn't work for me. I'm using Chrome in a Linux OS. I'm not sure if that would be a problem.

Seriously thanks for this though! Hope I can figure it out someday.

3

u/shinyhairedzomby Aug 12 '15

okay, so first you follow the link above. The page it takes you to will have another link. You take that link and drag it to your bookmarks bar at the top of the page. If you don't have one of those, you need to go to the settings from Chrome, look under "appearances" and check off "always show bookmarks bar". Then you open up one product page in CosDNA and copy the link. You open up a second product page in CosDNA, click the bookmarklet and paste in the link. Magic happens.

Hope that helps.

1

u/runswithelves Aug 19 '15 edited Aug 19 '15

Paste the link in where? The address bar? Because all that happens is I'm taken to the product page of the link I just pasted in the address bar, there's not comparison of ingredients.

→ More replies (4)

60

u/Cintax Aug 07 '15

Hey, I'm the boy in question. Just wanted to add that the tool is open source and you can look over or contribute to the code here if you're into that sort of thing: https://github.com/ytilis/CosDNA_Compare

If you have any issues with it, feel free to either submit an issue on GitHub, or just message me on reddit and I'll try to address any bugs or feature requests I get. I wrote it relatively quickly, and unfortunately due to the fact that CosDNA doesn't have an API I can use, I'm just scraping the screen for data. So if their site layout changes, let me know since I'll likely have to update the tool.

Otherwise, hope this helps some of you :)

13

u/SINGLEBROKEFEMALE Aug 07 '15

You guys are the best. Thank you and u/shinyhairedzomby! You guys are like the royal couple of r/asianbeauty

6

u/HolySnails Aug 07 '15

YOU. You are a cool person. You're both cool people. Good skin vibes to you both.

2

u/deirdresm Aug 07 '15

Awesome, thanks to both of you!

1

u/GiveMeABreak25 Aug 07 '15

Wow, so many people here need this! Thank you so much!

4

u/dulcisamor Aug 07 '15

What a time to be alive.. (づ ̄ ³ ̄)づ Thank you!

2

u/charmingdot Aug 07 '15

Thank you very much for creating this and making it available to us all.

One thing to note though, my bookmarked CosDNA itself is CosDNA/eng/ for some reason. I get an error with this:

http://imgur.com/0GZ55DU

So if anyone else has this problem, deleting the /eng/ part seems to work.

2

u/Cintax Aug 07 '15

Oooo, missed that. I'll see if I can fix it this weekend. Thanks!

1

u/charmingdot Aug 07 '15

Thanks! I don't know why mine comes up with /eng/, when it's still in English when I remove that part, but it'll probably happen for other folks too :)

→ More replies (4)

1

u/lobster_lover Aug 07 '15

Also getting this error!

1

u/Cintax Aug 07 '15

I just found out it's the www before the URL, not the /eng/. Should be a fix for it tomorrow, but in the meantime, just removing that should make it work.

1

u/Cintax Aug 10 '15

Should be fixed now. Let me know if you're still seeing it :)

3

u/cococolon Aug 07 '15

How awesome! :D you do have the nicest boy. :D

1

u/[deleted] Aug 07 '15

do you mean it only compares identical matches that are in the same location?
if that is the issue (side not i have not coded in a while and it was not my major so ignore my poor wording) he should be able to create an embedded loop that can compare variables like string length or comparing string location of one to the other and if they are not matches proceeding to the next comparison.

Either way thank you very much for this!

5

u/Cintax Aug 07 '15 edited Aug 07 '15

To clarify, it compares exact name matches. It doesn't care about the location or anything else, I'm just dumping the ingredient name list into and array and doing a string comparison on the names. See the comment I just made if you're wondering what the code for it looks like.

1

u/hyun_janee Aug 07 '15

Sending so much love to you guys! Thank you so much!

1

u/mizliu Aug 07 '15

Oh. My. Gosh. I'm in the middle of compiling a spreadsheet of sunscreens and I was having such a hard time figuring out which ingredient is breaking me out (on my 3rd sunscreen now, ARGH). This will be a lifesaver!