Skip to content

Instantly share code, notes, and snippets.

View kachina's full-sized avatar

Tetsuya Chiba kachina

View GitHub Profile
import datetime
import os
import pkg_resources
import pyowm
# 開発環境の場合は .env ファイルを読み込む
for dist in pkg_resources.working_set:
if dist.project_name == 'python-dotenv':
from dotenv import load_dotenv
OWM_API_KEY=#{開発用のAPI Key}
OWM_PLACE=Chiba,Jp
import os
import pkg_resources
import pyowm
# 開発環境の場合は .env ファイルを読み込む
for dist in pkg_resources.working_set:
if dist.project_name == 'python-dotenv':
from dotenv import load_dotenv
load_dotenv()
OWM_API_KEY=#{開発用のAPI Key}
OWM_PLACE=Yokohama,Jp
OWM_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OWM_PLACE=Tokyo,Jp
[flake8]
ignore = E501
exclude = .aws-sam
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 900
Environment:
Variables:
TZ: Asia/Tokyo
import os
import boto3
def main():
s3_client = boto3.client('s3')
params = {'Bucket': 'example-bucket'}
while True:
import os
import boto3
def main():
s3_client = boto3.client('s3')
response = s3_client.list_objects_v2(Bucket='example-bucket')
for content in response['Contents']:
@kachina
kachina / earthquake-notify-send.rb
Last active August 29, 2015 14:02
earthquake-notify-send.rb
require "fileutils"
require "digest/md5"
Earthquake.init do
dir = File.join(File.dirname(__FILE__), "userimage")
output do |item|
next if item.nil? || item['user'].nil? || item['_stream'].nil?
begin
image_url = item['user']['profile_image_url']
next unless image_url