Hey!
The google translate API is now a paid service, and I am making a software that needs to be able to translate stuff, and output the results in a textbox. I have searched, but I cant find out how to retrieve the results without using the API. I found a few tutorials on how to scrape it, but they were in PHP.
Bing translator would also be cool, but I dont know how I should go with the SOAP service.
Look into post data, and then with the returned string use regex to parse the results. I think this would be the way to do it with Google Translate.
EDIT: idb_'s http class would work fine for this.
Yes, I looked into this, but I had problems deserializing it. Would you mind helping me write a little snippet for the purpose? Thanks!
(Dec 13, 2012 09:23 AM)Diazepa Wrote: Yes, I looked into this, but I had problems deserializing it. Would you mind helping me write a little snippet for the purpose? Thanks!
RegEx: http://www.youtube.com/watch?v=FpAvBOhDrYk
RegEx: http://www.youtube.com/watch?v=SUmSwV2lZ9U
POST: http://www.youtube.com/watch?v=7Wzel-g1U54
POST: http://www.youtube.com/watch?v=UV5_b5oaUQk
If none of those helped you.
God of knowledge: http://www.google.com
Thanks man! I'm done with it now! It was easier than I thought
(Dec 13, 2012 11:26 AM)Diazepa Wrote: Thanks man! I'm done with it now! It was easier than I thought
No problem, glad I could help. If you don't mind me asking, what is this for?
Dec 14, 2012 07:52 AM
(This post was last modified: Dec 14, 2012 07:57 AM by Diazepa.)
(Dec 13, 2012 11:29 AM)log dot zip Wrote: No problem, glad I could help. If you don't mind me asking, what is this for?
At school, we are allowed to use a dictionary software on tests, but thats it. VB.NET is perfect for easy designing, and I managed to accurately replicate the GUI of the dictionary. Only difference is that this can translate whole sentences under the guise of being an allowed application. I programmed in some hotkeys so you are able to change the text field in an instant in case of teachers. Sorry if you were expecting something huge lol!
(Dec 13, 2012 12:32 PM)Pussy Cat Wrote: You can still use Google
http://translate.google.com/translate_a/...UAGE_&sc=0
I managed to get that link myself, by turning off immediat translation, inspecting an element in the browser, and go to "network".
The real problem was that the output file was rather serialized (look at it yourself). I used regex to extract the info fields.
Only problem is that I get every suggestion too, and this looks rather weird. Also, you cant use the " sign in the text you are to translate, because that is the split operator. Tried using a textbox1.text.replace(""""), ("'") line of code, to filter them out - but It dosen't seem to work. If I have the willpower to, I can probably fix this in five minutes though lol!
(Dec 14, 2012 07:52 AM)Diazepa Wrote: At school, we are allowed to use a dictionary software on tests, but thats it. VB.NET is perfect for easy designing, and I managed to accurately replicate the GUI of the dictionary. Only difference is that this can translate whole sentences under the guise of being an allowed application. I programmed in some hotkeys so you are able to change the text field in an instant in case of teachers. Sorry if you were expecting something huge lol!
I managed to get that link myself, by turning off immediat translation, inspecting an element in the browser, and go to "network".
The real problem was that the output file was rather serialized (look at it yourself). I used regex to extract the info fields.
Only problem is that I get every suggestion too, and this looks rather weird. Also, you cant use the " sign in the text you are to translate, because that is the split operator. Tried using a textbox1.text.replace(""""), ("'") line of code, to filter them out - but It dosen't seem to work. If I have the willpower to, I can probably fix this in five minutes though lol!
That's actually a quiete good idea if you're only allowed to use one piece of software.
This will require an internet connection, which would surly be disallowed in a testing environment. If not, whats stopping you using google translate via a browser?
Dec 14, 2012 08:47 AM
(This post was last modified: Dec 14, 2012 08:47 AM by pica.)
(Dec 14, 2012 08:11 AM)carrot223 Wrote: This will require an internet connection, which would surly be disallowed in a testing environment. If not, whats stopping you using google translate via a browser?
Exactly what I was thinking... Please explain to me OP.
The class I am attending is a mix between two schools, as it is a small class.
This results in the teacher not being able to block the internet access of half the students, thus she dosen't bother at all.
So if we are using a computer, we have to sit so she can see the screen, and what's going on. Using chrome would cause much shit, but I if we cloak google translate as an allowed piece of software, then she will only see what looks like a student looking up a word from a local database, rather than us getting the sentence translated by google.
Also, cell phone access points if she figures out how to block us.
Glad you like the idea, I wasn't planning on using it really, but it was fun to make, and it turned out great so what the fuck :D
|