Skip to content

Commit

Permalink
✏ ブロック処理の実装
Browse files Browse the repository at this point in the history
  • Loading branch information
10mocy committed Jan 17, 2018
1 parent 52bc11c commit 14ccb56
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions protect-yourself/twitter/block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
session_start();
require_once("twitter-config.php");
require_once("twitteroauth/autoload.php");

use Abraham\TwitterOAuth\TwitterOAuth;

$accesstoken = $_SESSION["access_token"];
$blocklist = $_POST["user"];
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $accesstoken['oauth_token'], $accesstoken['oauth_token_secret']);

foreach($blocklist as $block) {
$connection->post("blocks/create", [
"user_id" => $block
]);
}
?>
success
5 changes: 3 additions & 2 deletions protect-yourself/twitter/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ function(response_json) {
},
function(response) {
if(response === "success") {
alert("処理が完了しました。");
alert("正常に処理が完了しました。\nご協力ありがとうございました。");
window.location.href = "./";
}
//block_btn.innerText = "ブロック処理を開始";
//block_btn.removeAttribute("disabled");
}
)
block_btn.removeAttribute("disabled");
}
</script>
<?php
Expand Down

0 comments on commit 14ccb56

Please sign in to comment.