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
var toilets: [Toilet] = [] | |
var requestUrl: String? | |
func getToilets() { | |
Alamofire.request(self.requestUrl!) | |
.validate(statusCode: 200..<400) | |
.responseJSON { [weak self] response in | |
guard let strongSelf = self else { return } | |
guard let _ = response.response else { | |
return |
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
require 'open-uri' | |
require 'nokogiri' | |
require 'line/bot' | |
url = 'http://www.beasup-online.com/shopdetail/000000000001/' | |
charset = nil | |
error_message = '' | |
begin | |
html = open(url) do |f| |
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
# 正規表現 | |
japanese_regex = /[\p{Han}\p{Hiragana}\p{Katakana},.、。ー・]+/ | |
File.open('./japanese.txt', 'w') do |japanese_file| | |
Dir.glob('views/**/*.html.erb') do |template_file| | |
# ファイル名出力 | |
japanese_file.puts("対象ファイル名:#{template_file}") | |
# ファイル読み込み | |
text = File.read(template_file, encoding: Encoding::UTF_8) |
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
<?php | |
// UA取得 | |
$userAgent = $_SERVER['HTTP_USER_AGENT']; | |
// テスト用UA | |
// 5.1系Chrome | |
// $userAgent = "Mozilla/5.0 (Linux; Android 5.1; KYV35 Build/xxxx) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Mobile Safari/537.36"; | |
// 5.1系WebView | |
// $userAgent = "Mozilla/5.0 (Linux; Android 5.1; KYV35 Build/xxxx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36"; | |
// 5.0系Chrome |