This repository has been archived by the owner on Nov 24, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize bot pastebin usage, add pastebin selection to config
- Loading branch information
Showing
10 changed files
with
34 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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,14 +1,29 @@ | ||
#!/usr/bin/env python | ||
import requests, urllib2 | ||
import config | ||
|
||
def paste(data): | ||
if config.PASTEBIN == 'sprunge': | ||
return sprunge(data) | ||
if config.PASTEBIN == 'nnmm': | ||
return nnmm(data) | ||
if config.PASTEBIN == 'sicpme': | ||
return sicpme(data) | ||
if config.PASTEBIN == 'ix': | ||
return ix(data) | ||
raise NotImplementedError | ||
|
||
def sprunge(data): | ||
sprunge_data = {"sprunge": data} | ||
response = requests.post("http://sprunge.us", data=sprunge_data) | ||
message = response.text.encode().strip('\n') | ||
return message | ||
|
||
def pastebin(data): | ||
raise NotImplementedError | ||
|
||
def nnmm(data): | ||
return urllib2.urlopen("https://nnmm.nl", data).read() | ||
|
||
def sicpme(data): | ||
return requests.post('https://sicp.me/', data={'paste': data}).text.encode().strip('\r\n') | ||
|
||
def ix(data): | ||
return requests.post('http://ix.io/', data={'f:1': data}).text.encode().strip('\r\n') |