Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
no twitter implementation yet, however this converts image and downloads it
  • Loading branch information
supthunder authored Jan 18, 2017
1 parent e74aed7 commit 63244c7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
from bs4 import BeautifulSoup
import requests
import re
import json
import re
import urllib.request




def uploadImage(url):
file = {'image': open('test.png','rb')}
r = requests.post(url, files=file)
soup = BeautifulSoup(r.text,"html.parser")

imageLink = (soup.find(bgcolor='black')).find('img')['src']
nameRegex = re.compile('[^/]*$')
imageName = "./"
imageName += re.search(nameRegex, imageLink).group(0)
urllib.request.urlretrieve(imageLink, imageName)

def main():
url = "http://www.text-image.com/convert/matrix.cgi"
uploadImage(url)
main()

0 comments on commit 63244c7

Please sign in to comment.