[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
database API visual novel question
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 12
Thread images: 1
File: 1295285045667.jpg (257 KB, 900x599) Image search: [Google]
1295285045667.jpg
257 KB, 900x599
Hey /g/, I need some help.

I'm going to on deployment for a half a year and won't have regular internet access (at least none I want to look up this information on). I've got 2TB of downloaded visual novels / nukige to keep my supplied with fap material. However I don't remember everything about every title I have, usually I look up everything on vndb.org to find what I'm in the mood for by their tag mechanism.

But when I'm on deployment I can't access vndb.org and I'm basically just picking at random hoping something will pique my interest.

vndb.org has an API for accessing their database (https://vndb.org/d11), and there's a way to send a query that'll return the VN title and all the tags associated with it. I want to download that part of the database associating the title with the tags to some kind of file (excel, notepad, doesn't really matter) so I can browse my collection by tags rather than just looking at the title. But the limit of my programming knowledge is writing for and while loops in python. I don't know how to use these APIs to request and save the information from the database myself.

Is there some kind of resource I can look this up myself?
>>
How the hell did you get 2TB of VNs?
>>
>>52090937
I downloaded them. From sukebei.nyaa.org. I would search on vndb.org for what I wanted, copypaste the title into sukebei.nyaa, and away I went. Almost everything is on there except a few things that aren't available anywhere (except dlsite).

Do you know how to use APIs? I imagine there's a way in python but I only have a week to figure this out and make all the requests.
>>
>>52090993
Yeah, you can do it in Python. Their API uses JSON for communication, with a 0x04 character after each command to tell the server you're finished sending that command. What you'd need to do is:

1. Make a TCP connection to port 19534 on api.vndb.org
2. Send them the login command from that API reference page with your credentials substituted in.
3. Iterate over all VN names in your collection
4. Do some sort of fuzzy matching on the names (this is the hard part since I'd imagine lots of them are similar). I'd probably just use their "get vn" command with a partial title (title ~ "osananajimi" in their example).
5. Write the data to a CSV or whatever.
>>
>>52091216
I was going to be lazy and pull the entire listing, since it's only something like 19000 listings. Then I could sort the data by tag and look through my collection for matches by hand.

I'm glad it looks like it'll work though. I'll fool around with it tonight and hopefully get a good script working before too late.
>>
>>52091216
How do I include a 0x04 character in each command? Sorry for being dumb.
>>
>>52090908
Who is this masturbation station?
>>
>>52091472
Not the best at python (mainly do lower level languages) but I'd assume you'd do Char(0x04) and append that to the end of your command string. Either that or convert 0x04 directly to a string and concat it I'm not sure what's more pythonic
>>
>>52091516
awesome I figured out how to get that character into my strings.

Now to figure out logging in.
>>
>>52091216
>1. Make a TCP connection to port 19534 on api.vndb.org

How would I do that? Should I just use the code from here? https://wiki.python.org/moin/TcpCommunication
>>
I wish they just made their database available for download. This is hard.

I'm not sure how to send my login command. I'm trying to use s.send with the socket library, if anyone knows what I'm talking about.
>>
>2. Send them the login command from that API reference page with your credentials substituted in.

I'm trying to do this right now using the send command from the socket library, but it throwing up an error about 'str' does not support the buffer interface. What's going on?
Thread replies: 12
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.