This repository has been archived by the owner on Dec 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Krypton-Byte
committed
Oct 20, 2020
1 parent
a9bdb42
commit 7dd0f38
Showing
18 changed files
with
1,157 additions
and
105 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from lib.sdmovie import fun | ||
from lib.chatbot import chatbot | ||
from lib.cropToSquare import crop_image, resizeTo, pasteLayer | ||
from lib.menu import menu | ||
from lib.api import * | ||
from lib.kasar import * | ||
from lib.brainly2 import * | ||
from lib.nulis import tulis | ||
from lib.anime import * | ||
from lib.ig import igdownload |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import requests, re, random | ||
from urllib.parse import quote | ||
from bs4 import BeautifulSoup | ||
def gsearch(query): | ||
''' | ||
query : String | ||
''' | ||
src = requests.get("https://www.google.com/search?q="+quote(query)).text | ||
return re.findall('<a href="/url\?q\=(.*?)\&',src) | ||
def brainly(url): | ||
''' | ||
url : string | ||
e.g brainly("https://brainly.co.id/tugas/2754169") | ||
''' | ||
headers={'user-agent':"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4183.102 Safari/537.36"} | ||
get=requests.get(url, headers=headers) | ||
bs=BeautifulSoup(get.text,'html.parser') | ||
answer="" | ||
pertanyaan=bs.find_all('span',class_='sg-text sg-text--large sg-text--bold sg-text--break-words brn-qpage-next-question-box-content__primary')[0].text | ||
for jw in bs.find_all("div", class_="sg-text sg-text--break-words brn-rich-content js-answer-content"): | ||
for jawaban in jw.find_all("p"): | ||
answer+="\n%s"%jawaban.text | ||
return { | ||
'soal':pertanyaan, | ||
'jawaban':answer.strip() | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,14 @@ | ||
import random | ||
class chatBot: | ||
'''input chat e.g chatbot("Hi")''' | ||
def __init__(self, req): | ||
self.req = req.lower().split() | ||
self.list_ask = ["aku","sayang","kamu"] | ||
self.balas_ask = ["same",":)","kamu bilang apa"] | ||
self.list_odading = ["hiu","tomat"] | ||
self.list_intro = ["hi","hai","hello","hai","p","bro","halo","hallo","helo"] | ||
self.balas_intro = ["iya","ada apa gan","ya hallo","ada apaan gan","Ya"] | ||
self.list_rumah = ["dimana","rumah","kamu","tempat","tinggal","daerah","di","mana"]; | ||
self.balas_rumah = ["Jawa Barat","jawa Tengah","Jawa Timur"] | ||
self.list_nama = ["siapa","nama","kamu","namanya"] | ||
self.balas_nama = ["nama saya chappie","nama saya chappie atau bisa di sebut Bot whatsapp"] | ||
self.list_author = ["siapa","author","pembuat","pencipta","menciptakan","kamu"] | ||
self.balas_author = ["Ntah","saya Tidak Tahu"] | ||
self.list_salam = ["assalamu'alaikum","asalamualaikum"] | ||
self.balas_salam = ["wa'alaikumsalam","Wa'alaikumsalam"] | ||
self.list_fav_makanan = ["makanan","favorit","kesukaan"] | ||
self.balas_fav_makanan = ["Nasi Goreng","Telur Ceplok","Mie Goreng"] | ||
def max_(self): | ||
self.rumah = len(set(self.list_rumah) & set(self.req)) | ||
self.nama = len(set(self.list_nama) & set(self.req)) | ||
self.author = len(set(self.list_author) & set(self.req)) | ||
self.salam = len(set(self.list_salam) & set(self.req)) | ||
self.intro = len(set(self.list_intro) & set(self.req)) | ||
self.fav_makanan = len(set(self.list_fav_makanan) & set(self.req)) | ||
self.ask = len(set(self.list_ask) & set(self.req)) | ||
self.odading = len(set(self.list_odading) & set(self.req)) | ||
self.list=[self.rumah, self.nama, self.author, self.salam, self.fav_makanan, self.intro, self.ask, self.odading] | ||
def balas(self): | ||
maks=max(self.list) | ||
if 'bot' in self.req and set(['goblok','tolol'])&set(self.req): | ||
return random.choice(["yg main bot gk ada akhlak","nama nya juga bot","aku ini bukan bot sepeti ML (machine learning) yg bisa di ajarin"]) | ||
elif maks == 0: | ||
return False | ||
elif self.rumah == maks: | ||
return random.choice(self.balas_rumah) | ||
elif self.nama == maks: | ||
return random.choice(self.balas_nama) | ||
elif self.author == maks: | ||
return random.choice(self.balas_author) | ||
elif self.salam == maks: | ||
return random.choice(self.balas_salam) | ||
elif self.fav_makanan == maks: | ||
return random.choice(self.balas_fav_makanan) | ||
elif self.intro == maks: | ||
return random.choice(self.balas_intro) | ||
elif self.ask == maks: | ||
return random.choice(self.balas_ask) | ||
elif self.odading == maks: | ||
return "Goblok !!!" | ||
|
||
|
||
import requests, json | ||
def chatbot(question): | ||
headers = { | ||
'content-type': 'application/json', | ||
'x-api-key': 'bnqqPT2Hq0UJVTKtmMeiAz6DaUjBaE8-jA0ap_UX' | ||
} | ||
data = { | ||
'utext': question, | ||
'lang': 'id', | ||
'country': ['ID'], | ||
'atext_bad_prob_max': '0.7' | ||
} | ||
req=requests.post("https://wsapi.simsimi.com/190410/talk/",data=json.dumps(data), headers=headers) | ||
return req.json().get("atext","Simi Lagi Sibuk :)") |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
''' | ||
@author : Krypton Byte | ||
''' | ||
import requests | ||
def igdownload(url): | ||
req=requests.get(url, params={"__a":1}) | ||
if ('graphql' in req.text): | ||
media=req.json()["graphql"]["shortcode_media"] | ||
if media.get("is_video"): | ||
return {"status": True,"result":[{"type":"video", "url":media["video_url"]}]} | ||
elif media.get("edge_sidecar_to_children"): #multiple media | ||
med={"status":True, "result":[]} | ||
for i in media["edge_sidecar_to_children"]["edges"]: | ||
med["result"].append( {"type":"video","url":i["node"]["video_url"]} if i["node"]["is_video"] else {"type":"image","url":i["node"]["display_resources"][-1]["src"]}) | ||
return med | ||
else: #1 media | ||
return {"status":True,"result":[{"type":"image","url":media["display_resources"][-1]["src"]}]} | ||
else: | ||
return {"status":False} |
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
Oops, something went wrong.