This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
| from urlparse import urlparse | |
| from reading import mecab | |
| import json, urllib | |
| class MyHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| expr = u"カリン、自分でまいた種は自分で刈り取れ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!perl | |
| use v5.12; | |
| use strict; | |
| use warnings; | |
| use WWW::Mechanize; | |
| use Cwd; | |
| my $mech = WWW::Mechanize->new( autocheck => 1 ); | |
| my $desktop= "Desktop"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!perl | |
| package DirectoryTraverser; | |
| use strict; | |
| use warnings; | |
| sub new() | |
| { | |
| my $class = shift; | |
| my $self = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import sqlite3 | |
| import re | |
| #or another Rikaichan formatted dictionary file | |
| d='.anki\\plugins\\yomichan_plugin\\languages\\japanese\\data\\dict.sqlite' | |
| f=sqlite3.connect(d).cursor() | |
| lookups=[(u'とく', u'徳')] | |
| def findWordsWithSameKanjiandReading(kana, kanji): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ass2srt.py | |
| Converts the currently set .ass subtitle to .srt and sets it as the subtitle for the current video | |
| """ | |
| import re | |
| import xbmc | |
| from os.path import basename, splitext | |
| from datetime import time | |
| import traceback | |
| import codecs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Recursivly traverses a FTP directory, picking a random user-given number of files and outputting them in the format | |
| {image: http://<filename>} | |
| """ | |
| import ftplib | |
| import random | |
| from optparse import OptionParser | |
| def traverse(ftp, depth=0): | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| A HTTP server that proxies GET requests to a FTP server | |
| """ | |
| import ftplib | |
| from mimetypes import guess_type | |
| import BaseHTTPServer | |
| from urllib2 import unquote | |
| from optparse import OptionParser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!perl | |
| use v5.12; | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Unicode::UCD 'charinfo'; | |
| my $SENTENCE = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xbmc | |
| import shutil | |
| ass_subtitle='special://temp/%s' % xbmc.Player().getSubtitles() | |
| shutil.copy(ass_subtitle, 'Q:\\scripts\\') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib2 | |
| import re | |
| uid='xv3f6f' | |
| f = urllib2.urlopen('http://www.dailymotion.com/embed/video/%s' % uid).read() | |
| url=re.findall('"stream_h264_url":"(.*?)",', f, re.DOTALL) | |
| resolved_url=url[0].replace('\\','') | |
| print resolved_url |