Script Registry -- for script authors; track your script usage

Theraze

Active member
Okay, try using 211.138.124.233 as the host, 80 as the port, and check the box to use a proxy. Then see if it works for you... Those options go on the 'connection' tab prelogin. Just to make clear. :)

Appears to use HTTP proxy, not socks. All the socks proxies I tried failed miserably. Second HTTP (first non-transparent) worked fine.
 

Bale

Minion
Thanks Theraze. I still can't access his site in my browser (of course), but at least the script works now. Bad news is that it's a little laggy this way. At least I've finally got the registrations out of my inbox. :)
 

Theraze

Active member
May want to try to check with the host and see if you can figure out why they're blacklisting you? That's probably an email process though, and one not likely to get you fixed for at least a day or two. But better than longterm laggy KoLing. :)
 

Bale

Minion
Which host would I email? 68.13.8.214 or wsip-98-175-61-16.om.om.cox.net? And how would I find the email of their web administrator? (I am incapable of checking the website after all.)
 

Theraze

Active member
Well, according to a whois, it's registered through Godaddy. Not sure if they're hosting it or just providing the name lookup though... In their case, I'd suggest doing the contact through Godaddy.com and just checking there.

If it's Cox (more likely) that's blocking you, http://whois.domaintools.com/98.175.61.16 suggests that Jason Weil may be the right person to email. His contact info is there. OrgTechEmail, not OrgAbuseEmail. FYI, Jason Weil is the contact for the 68.13.8.214 IP as well.
 

zarqon

Well-known member
If you PM me any relevant info about your IP/ISP, I'll check it with my host, who I know personally. I had some problems once because a block of Korean IP's were blocked.

EDIT: We worked it out; Bale was blocked. For future reference, don't name your scripts things that contain "CD " -- after urlencoding that, it appeared like an insertion attempt and thus his IP was blocked. Exceptions were made for those specific URLs.
 
Last edited:

StDoodle

Minion
I'd love to start using this, but I'm curious as to whether I should still [register] using the script name if I'm using the "script" command, or if I should use that. I assume the latter, but I'm not sure. Also, I didn't see anything about the apostrophe issue being fixed, and a few of my scripts go by "StDoodle's ..."
 

Bale

Minion
I wouldn't use notify if I didn't use this script. It's just super awesome! Put it in your login script to simply read a summary of whom is using your script and which of them are new!

I'd love to start using this, but I'm curious as to whether I should still [register] using the script name if I'm using the "script" command, or if I should use that. I assume the latter, but I'm not sure.

Use the name of the script that is kmailed to you by the notification command.

I don't know anything about an apostrophe issue, but judging by the apostrophe in the name of this script I'd say it is probably fixed.
 

Alhifar

Member
I've edited my local copy of parse_mail() to check all pages, instead of just the first one. I've gone long enough between logins a few times that I have multiple pages of notify commands. My local copy is as follows (beware the regex, zarqon!)
Code:
message[int] parse_mail() {
   message[int] parsedmail;
  // get a map of kmail in html
   vprint("Checking mail...",2);
   string temp = visit_url("messages.php");
   if (contains_text(temp,"There are no messages in this mailbox.")) return parsedmail;
   temp = substring( temp , 0 , index_of( temp , "Mailbox:" ) );
   matcher m_pages = create_matcher( "<a href='messages\\.php\\?box=Inbox&begin=(\\d+)'>\\[\\d+\\]</a> " , temp );
   int pages = 1;
   while( m_pages.find() ){
	pages = m_pages.group(1).to_int();
   }
   for page from 1 upto pages{
      temp = visit_url( "messages.php?box=Inbox&begin="+page );
      temp = substring(temp,index_of(temp,"checkbox name=\"")+15);
      string[int] km = split_string(temp,"checkbox name=\"");
      int p = 0;
      for i from 0 upto count(km)-1 {
         if (contains_text(km[i],"I have opted to let you know that I have chosen to run ") ||
            contains_text(km[i],"[register ") ||
            contains_text(km[i],"[url for ") ||
            contains_text(km[i],"[unregister ")) {
               // parse html into record structure
               parsedmail[p].id = to_int(substring(km[i],3,index_of(km[i],"\"")));
               parsedmail[p].text = excise(km[i],"<blockquote>","</blockquote>");
	       temp = substring(km[i],index_of(km[i],"showplayer.php"));
               parsedmail[p].sender = url_encode(substring(temp,index_of(temp,">")+1,index_of(temp,"</a>")));
               temp = substring(km[i],index_of(km[i],"<b>Date:</b> ")+13);
               parsedmail[p].date = url_encode(substring(temp,0,index_of(temp,"<")));
               p = count(parsedmail);
            }
       }
   }
   vprint(to_string(count(parsedmail))+" messages queued.","blue",2);
   return parsedmail;
}
 

zarqon

Well-known member
Ooooh, shiny! I login often enough that even if there are leftovers on another page, they get dealt with the following day -- but this is a nifty addition nonetheless.

@Doodle: Try it, and if there are any apostrophe issues we can work them out.
 

zarqon

Well-known member
Today's Update

Registry.ash now uses ZLib's shiny new load_kmail(). This means less code and less load -- win/win!

Less code: simply calls load_kmail() and everything's there in a map, ready for foreaching.

Less load: it visits KoL's api.php which is just a PHP array_to_string() rather than a human-readable HTML page. And, it returns up to 100 kmails rather than your default messages-per-page limit, meaning you'll only need multiple server hits if you have more than 100 incoming kmails. Possible, but quite uncommon.
 

Bale

Minion
Awesome. Now I've got to pull it apart and add in my personal modifications. Mine is pretty heavily modded to do some other things with my mail at the same time.
 

slyz

Developer
I seem to be having a problem when I try to register a URL for a script:
Code:
> call registry.ash

Message 1: Registering URL for 'Nemesis Quest Script'...
[COLOR="#ff0000"]You know those people that say 'No URL is good URL'? We are not them.[/COLOR]
[COLOR="#0000ff"]0 messages processed successfully.[/COLOR]
Printing report...

Here is the content of the kmail I send to myself:
Code:
[url for Nemesis Quest Script is http://kolmafia.us/showthread.php?4761]
 

zarqon

Well-known member
Aha -- api.php doesn't add the clicky [link] bit before a URL; that must only be done in messages.php when your kmail is fetched.

I think that's great, we can go back to simply parsing the URL out of the kmail using the simpler syntax. Updated but not tested, should be fixed.
 

slyz

Developer
Oh, I added a print(url) to check if it was parsing correctly, but i didn't notice the excise() in the return value!
The update works, thanks.
 

Bale

Minion
I have discovered one crappy thing about the api. It doesn't tell you if a message is new. I'm going to have to keep track of the most recently received message ID so that the script can tell if there are new (non-registration) messages since it was last run.
 
Top