Forum Settings
Forums
New
Oct 29, 2013 12:29 AM
#1

Offline
Feb 2008
600
I'm not some pro app maker or anything. With very basic knowledge of sockets for mIRC scripting, I've managed to create a script searches for anime. Here's the code for it below:

http://www.nomorepasting.com/getpaste.php?pasteid=39650&seen=true&wrap=on&langoverride=mirc

Now according to Xinil's latest post, I have to PM some "identifier" that I'm using and change my script somehow. But what exactly do I PM him? Where would I make an addition to my script? My app doesn't have a name, and I don't know what "user agent" is... Hopefully someone can help.

Thanks.

(Rotating Signature | Member Cards are fun~)



[Notes on Signature]124 - 172 KB, Width: 140px

Reply Disabled for Non-Club Members
Oct 29, 2013 1:05 AM
#2

Offline
Nov 2007
725
"Identifier" refers to the User-Agent string that is included in HTTP request headers. I don't know how mIRC scripts work, but I imagine you'd need to add something like "sockwrite -n mal.anime User-Agent: MyApplication/1.0" before the 27th line (the one with "$crlf").

That being said, looks like your script doesn't use the search method provided by the API and just parses the regular HTML search page instead, so this may not apply to you.
Oct 29, 2013 1:11 AM
#3

Offline
Feb 2008
600
Yeah, I noticed it doesn't use the API, however the socket connection doesn't actually get any parsable html anymore. Instead I get this (courtesy of the write %sockread):

http://www.nomorepasting.com/getpaste.php?pasteid=39651

EDIT: I got banned from MAL after trying to PASTE this into the forums. (I don't know why.) I'm not hacking or anything wtf, it's just mIRC sockets...
KholdStare88Oct 29, 2013 1:32 AM

(Rotating Signature | Member Cards are fun~)



[Notes on Signature]124 - 172 KB, Width: 140px

Oct 29, 2013 2:17 PM
#4

Offline
Nov 2007
725
KholdStare88 said:
Yeah, I noticed it doesn't use the API, however the socket connection doesn't actually get any parsable html anymore. Instead I get this (courtesy of the write %sockread): http://www.nomorepasting.com/getpaste.php?pasteid=39651

I see, that's the same HTML page that API users get. You could try parsing the "Set-Cookie" headers, repeating the same request with a "Cookie" header and see if it works. However, scraping HTML pages for whatever reason is generally frowned upon, and you should prefer the API methods if you're able to achieve the same results with them. That'd be both easier to parse for you and more considerate towards MAL's servers.

In any case, the problem with unique identifiers still stands. Yours is a good example of a use case that I think was not considered: There may be simple scripts written for specific jobs, which are not proper applications with proper names. Do they have to make up a name like "MyMircScriptThatSearchesAnime"? How is Crave going to deal with them? I imagine people are not going to enjoy this barrier of entry and they will either give up on development, or find another solution such as spoofing a well-known application's User-Agent string. Client registration for third-party developers isn't something unusual, but there should probably be an easier way for this, unless you actually want to complicate the process in order to weed out less serious ones.

KholdStare88 said:
I got banned from MAL after trying to PASTE this into the forums. (I don't know why.) I'm not hacking or anything wtf, it's just mIRC sockets...

I think some people used to post malicious HTML/JS code, so MAL implemented that as a security measure. Unfortunately, it blocks this kind of false-positives too.

P.S: I'm not sure why Xinil decided to post his message to the Unofficial MyAnimeList API club. If that's a mistake, perhaps a mod should move that topic as well as this one to the (official) MAL API club.
Nov 2, 2013 8:08 PM
#5

Offline
Mar 2012
158
Note that the endpoint at mal-api.com sends its own User Agent, so until the owner of that site gets the UA whitelisted, noboy will be able to use it. No matter what your client sends in its requests to that site, it won't matter.

You could run your own copy on your own server, if you wanted. It's open source and in ruby. All you'd need to do is set the User Agent it sends to one of your own creation and get that whitelisted.
Developer, sysadmin, and anime addict.
Have an Android smartphone? Try Atarashii!
Reply Disabled for Non-Club Members

More topics from this board

» Potential Re-factor of API

removed-user - Mar 19, 2014

3 by motoko »»
Sep 24, 2014 10:19 AM

» Has anyone been whitelisted?

riotopsys - Nov 6, 2013

13 by Fribbtastic »»
Jan 9, 2014 8:39 AM

Sticky: » 3rd party app not working? Look here!

Xinil - Oct 28, 2013

0 by Xinil »»
Oct 28, 2013 10:26 PM

» Is this still alive ?

FaustIMetal - Dec 25, 2012

1 by tblob »»
Jan 4, 2013 1:39 PM

» MAL For Android

riotopsys - Aug 4, 2010

0 by riotopsys »»
Aug 4, 2010 10:18 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login