This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Twiter-OAUTHのWebクライアント形式で認証サンプル | |
# | |
# 設定ファイルの書式 (ConfigParser) | |
# [TOKENS] | |
# ACCESS_TOKEN=HOGE | |
# ACCESS_SECRET_TOKEN=FUGA | |
# "#"や";"が最初につく行はスキップ | |
# |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from tweepy import OAuthHandler, Stream, StreamListener, TweepError, API | |
import urllib | |
from wsgiref.simple_server import make_server | |
import threading | |
import ConfigParser | |
import webbrowser | |
import os | |
import sys |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
from email.MIMEText import MIMEText | |
from email.Utils import formatdate | |
import smtplib | |
import datetime | |
#LOGファイル |
This file contains 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
def import_simplejson(): | |
try: | |
import simplejson as json | |
except ImportError: | |
try: | |
import json # Python 2.6+ | |
except ImportError: | |
try: | |
from django.utils import simplejson as json # Google App Engine | |
except ImportError: |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = 'Yoshihiro Misawa' | |
def recursion(int_list, cnt=0): | |
try: | |
xlen = len(int_list) -1 | |
if int_list[cnt] > 0: |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from os import system, name as osname, getcwd, chdir | |
from sys import path | |
from commands import getoutput | |
from popen2 import popen3 | |
cdir = getcwd() |
This file contains 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
/* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
def _enc_image(filename, max_size): | |
try: | |
if os.path.getsize(filename) > (max_size * 1024): | |
print 'File is too big, must be less than %d' % (max_size * 1024) | |
except os.errno, e: | |
print 'Unable to access file, %s' % e | |
file_type = mimetypes.guess_type(filename) | |
if file_type is None: | |
print 'Could not datermine file type' |
This file contains 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 __future__ import generators | |
__author__ = "Yoshihiro Misawa (remu.biz)" | |
__version__ = "0.0.1" | |
__copyright__ = "Copyright (c) 2011 Yoshihiro Misawa" | |
__license__ = "" | |
import urllib2 |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from webm.encode import WebPEncoder | |
from webm.handlers import BitmapHandler | |
import Image | |
import os | |
fpath = os.path.join( os.path.dirname( __file__ ), "test.jpg" ) | |
im = Image.open(fpath) |
OlderNewer