- run
docker-compose up
. - confirm you get
PIL
andPillow-6.1.0.dist-info
directory next .yml file. - upload them as AWS Lambda Layer
View lambda_function.py
import json | |
import boto3 | |
""" | |
API gateway URL example. You have to allow your quicksight domin setting to be accessed from amazonaws.com including subdomains. | |
https://xxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/xxx-gateway-stage-xxxx/your-lambda-func-name?dashboard_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxx | |
""" | |
def lambda_handler(event, context): | |
dashboard_id=event["queryStringParameters"]['dashboard_id'] |
View result.json
{"A Coru\u00f1a": "Spain", "Aachen": "Germany", "Aalborg": "Denmark", "Aarhus": "Denmark", "Aba, Nigeria": "Nigeria", "Abadan, Iran": "Iran", "Abaetetuba": "Brazil", "Abakan": "Russia", "Abbotabad": "Pakistan", "Abbotsford, British Columbia": "Canada", "Abengourou": "Ivory Coast", "Abeokuta": "Nigeria", "Aberdeen": "United Kingdom", "Abha": "Saudi Arabia", "Abidjan": "Ivory Coast", "Abiko, Chiba": "Japan", "Abilene, Texas": "United States", "Abohar": "India", "Abu Al-Khaseeb": "Iraq", "Abu Dhabi": "United Arab Emirates", "Abu Ghraib": "Iraq", "Abuja": "Nigeria", "A\u00e7ail\u00e2ndia": "Brazil", "Acapulco": "Mexico", "Acarigua": "Venezuela", "Accra": "Ghana", "Achalpur": "India", "Acheng District": "China", "Achinsk": "Russia", "Adama": "Ethiopia", "Adana": "Turkey", "Adapazar\u0131": "Turkey", "Addis Ababa": "Ethiopia", "Adelaide": "Australia", "Aden": "Yemen", "Adhamiyah": "Iraq", "Adilabad": "India", "Adityapur": "India", "Ad\u0131yaman": "Turkey", "Ado-Ekiti": "Nigeria", "Adoni": "India", "Afyon": "Turkey |
View lambda_function.py
import requests | |
import base64 | |
def lambda_handler(event, content): | |
response = requests.get("https://github.com/umihico.png") | |
return { | |
"isBase64Encoded": True, | |
"statusCode": 200, | |
"headers": { "content-type": "image/jpg"}, | |
"body": base64.b64encode(response.content).decode("utf-8") | |
} |
View README.md
View api.php
<?php | |
use Illuminate\Http\Request; | |
/* | |
|-------------------------------------------------------------------------- | |
| API Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register API routes for your application. These |
View scraping.py
from selenium.webdriver import Chrome | |
from umihico.xlsx import to_xlsx | |
from time import sleep | |
c=Chrome() | |
urls=[ | |
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=17", | |
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=15", | |
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=16", | |
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=14", | |
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=13", |
View .alias
alias ls='ls -lhaGF' | |
alias pas='php artisan serve' | |
alias p='python' | |
alias a='atom' | |
alias d='docker' | |
alias c='pbcopy' | |
alias s='source' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' |
View .bash_profile
export PYENV_ROOT=/usr/local/var/pyenv | |
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi | |
source ~/.bashrc |
NewerOlder