Last active
December 29, 2015 17:09
-
-
Save judotens/7702630 to your computer and use it in GitHub Desktop.
SimSimi CLI chat
This file contains hidden or 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
# url sniffed frm mitmproxy | |
# ref: http://blog.philippheckel.com/2013/07/01/how-to-use-mitmproxy-to-read-and-modify-https-traffic-of-your-phone/ | |
import sys, urllib, urllib2, json, random | |
def tanya_simi(teks): | |
acak = str(int(random.uniform(100000,300000))) | |
data = {'av': 5.2, 'ft': 1.0, 'lc': 'id', 'os': 'i', 'req': teks, 'tz': "Asia/Jakarta", 'uid': acak} | |
url = "http://app.simsimi.com/app/aicr/request.p?" + urllib.urlencode(data) | |
data = urllib2.urlopen(url) | |
o = json.loads(data.read()) | |
res = o['sentence_resp'].replace("simi", "gw") | |
return res | |
if __name__ == "__main__": | |
try: tanya = str(sys.argv[1]) | |
except: print "python " + sys.argv[0] + " <message>" | |
print ">", tanya | |
print "-->", tanya_simi(tanya) |
This file contains hidden or 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
# chat results | |
$ python tanyasimi.py "haloo, kenalan dong" | |
> haloo, kenalan dong | |
--> Tidak mau, kaka jelek si |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment