Skip to content

Instantly share code, notes, and snippets.

orangain

Block or report user

Report or block orangain

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@orangain
orangain / amazon_order_history.py
Created Nov 14, 2017
werkzeug.exceptions.BadRequestKeyErrorになる問題に対応したamazon_order_history.py
View amazon_order_history.py
import sys
import os
from robobrowser import RoboBrowser
# 認証の情報は環境変数から取得する。
AMAZON_EMAIL = os.environ['AMAZON_EMAIL']
AMAZON_PASSWORD = os.environ['AMAZON_PASSWORD']
# RoboBrowserオブジェクトを作成する。
@orangain
orangain / README.md
Last active Jun 26, 2017
テーブルからのスクレイピング
View README.md

準備

$ python3 -m venv scraping
$ . venv/bin/activate
(venv) $ pip install scrapy

実行

@orangain
orangain / README.md
Last active Jun 18, 2016
Difference of extracted contents between Python 2 and 3
View README.md

Command to extract contents

$ python2 --version
Python 2.7.11
$ python3 --version
Python 3.5.1
$ git checkout master
$ python2 WikiExtractor.py --lists --links -b 100M in/jawiki-20150805-pages-articles.xml.bz2 -o out-py2-master
$ git checkout support-python3
@orangain
orangain / README.md
Last active Mar 16, 2016
Testing non-ASCII URLs with simple spiders.
View README.md

In my environment these spiders work well.

Environment:

(venv) $ python -V
Python 3.4.2
(venv) $ scrapy version
Scrapy 1.1.0rc3
@orangain
orangain / 01 - Mac OS X script to automatically start docker vm on system boot.md
Last active Jan 22, 2016
Mac OS X script to start Docker VM automatically on system boot
View 01 - Mac OS X script to automatically start docker vm on system boot.md

Setup

  1. Download com.docker.vm.plist and save it into ~/Library/LaunchAgents/.

    $ curl -sL https://git.io/vz2Y9 -o ~/Library/LaunchAgents/com.docker.vm.plist
    
  2. (Optional) Change <string>default</string> line if you are using different name of docker machine.

@orangain
orangain / 0_reuse_code.js
Created Jan 13, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View museums.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test_spider.py
# coding: utf-8
from __future__ import print_function
import scrapy
class TestSpider(scrapy.Spider):
name = 'test'
allowed_domains = ['capybala.com']
start_urls = (
View valid_meshcodes.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@orangain
orangain / 01_setup.sh
Last active Jan 22, 2016 — forked from krak3n/.zshrc
Mac OS X script to automatically start boot2docker on system boot
View 01_setup.sh
curl https://gist.github.com/orangain/5f74bf388f66778f0e47/raw/com.docker.boot2docker.plist -o ~/Library/LaunchAgents/com.docker.boot2docker.plist
launchctl load ~/Library/LaunchAgents/com.docker.boot2docker.plist
echo '$(boot2docker shellinit)' >> ~/.bash_profile
You can’t perform that action at this time.