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
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^wp-admin$ wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] |
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 | |
$posts = array(); | |
array_push($posts,(object) [ | |
'title' => $entry->title | |
,'author' => $entry->author | |
,'permalink' => $entry->url | |
,'created' => new Carbon('2019-07-29 12:24:51') | |
,'description' => $entry->description | |
,'content' => $entry->content | |
]); |
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 | |
$posts = array(); | |
array_push($posts,(object) [ | |
'title' => $entry->title | |
,'author' => $entry->author | |
,'permalink' => $entry->url | |
,'created' => new Carbon('2019-07-29 12:24:51') | |
,'description' => $entry->description | |
,'content' => $entry->content | |
]); |
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 | |
//APP_ENVで分岐 | |
Route::group([ | |
'domain' => 'fuga.hoge.'.((env('APP_ENV') == 'production') ? 'com' : 'app') | |
], function() { | |
Route::get('/', function () { return view('hoge/index'); }); | |
Route::resource('/app', 'AppController')->except([ | |
'index', 'create', 'edit' | |
]); | |
Route::get('/data/{any}', function ($any=null) { //vue-routerでルーティングする |
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 | |
//ローカル設定 | |
Route::domain('fuga.hoge.app')->group(function(){ | |
Route::get('/', function () { return view('hoge/index'); }); | |
Route::resource('/app', 'AppController')->except([ | |
'index', 'create', 'edit' | |
]); | |
Route::get('/data/{any}', function ($any=null) { //vue-routerでルーティングする | |
return view('hoge/data'); | |
})->where('any', '.*'); |
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 | |
$client = new \GuzzleHttp\Client([ | |
'cookies' => true | |
,'http_errors' => false | |
]); | |
$client->post('https://secure.nicovideo.jp/secure/login',[ | |
'form_params' => [ | |
'mail' => $mail, | |
'password' => $password | |
] |
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 | |
foreach ($result->get_items() as $item) { | |
echo $item->get_title(); | |
} |
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 | |
$feed = App::make('feed'); | |
$feed->title = 'Title'; | |
$feed->description = 'Description; | |
$feed->logo = 'Logo'; | |
$feed->link = url('tag'); | |
$feed->setDateFormat('carbon'); | |
$feed->pubdate = $posts[0]->created; | |
$feed->lang = 'ja'; |
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 | |
$feed = FeedReader::read( | |
'https://www.nicovideo.jp/tag/MikuMikuDance?sort=f&rss=2.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
<?php | |
$client = new \GuzzleHttp\Client([ | |
'base_uri' => 'https://example.com/wp-json/wp/v2/' | |
]); | |
$response = $client->get('media',[ | |
'query' => ['slug' => 'sample'] | |
]); | |
$result = json_decode($response->getBody()->getContents()); | |
return (count($result)) ? $result[0]->id : null; |