r/javahelp • u/[deleted] • Jul 02 '14
A Java Manga App
I want to make a java program. It has a search box to search mangas from different site. Then it will download the pages from the site.
It is an app like mangasearch you can find on android but use on a computer. The question is I don't know how to use java to search on manga websites and how to download the pages.
Thanks!
4
u/Blackduck606 Extreme Brewer Jul 03 '14
If you want HTML parsing, I've had a good experience with Jsoup. You can easily crawl webpages with it for content.
You should probably look into if the websites you want to access have APIs for them. If they don't, your best bet is probably to just search www.somerandomsite.com/?search=some+query and then use Jsoup to parse the results and then the Java standard lib can read content from websites. The problem you'll face constantly is that since you're hardcoding how navigate the website, the program will stop working correctly every time a website changes its layout.
1
Jul 03 '14
Do you think there is any ways for me to get into their database and collects the contents from there?
1
u/nret Jul 03 '14 edited Jul 03 '14
From an API you wouldn't get direct access to their DB, it would allow you to programmatically make calls to through the API to browse the site with out having to do web scraping.
So, no, it most likely wouldn't let you do that.
1
Jul 03 '14
Can I go into their database and collect the data from there even I don't have their API?
1
u/nret Jul 03 '14
Yes, if you can successfully scrap their website you can essentially rebuild their DB, but it would probably take your program longer than instant to get the job done (might even take days depending on how much is has to scrap)... Which will also need to be reran when they update mangos... Their webdevs would probably also notice the spike in traffic from your ip cause by your crawler, might be bad.
You'd be best off prompting the user for what they want, and using the sites search feature.
1
u/Blackduck606 Extreme Brewer Jul 03 '14
Not unless they publicly exposed their database. You can try going on pages and doing View Source to see if they have any calls in there that you could duplicate. Most websites have preprocessing (often through PHP but not exclusively) that make it so that you never see the database calls.
1
0
Jul 03 '14
[deleted]
1
Jul 03 '14
Thanks! I can't believe one of the most famous manga reader actually share its source code to public.
This is extremely helpful. Do you think I can open apk to read into the source code.
2
u/nret Jul 03 '14
Short answer. It wouldn't be useful to you.
Semi-ish long amswer. You can open it, but decompiling it to understandable java is an additional step.
And to be honest you probably wouldn't understand their code if you don't already firmly understand classes, inheritance, polymorphism, and all that awesome OOP jazz.
9
u/[deleted] Jul 02 '14
"Hey guys, I want to make this thing. How do I do all of it?"