version bump

This commit is contained in:
2017-04-09 17:39:59 +02:00
parent 08dd3dc7ae
commit a9786ed238
3 changed files with 36 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
# slideslurp
Give slideslurp a URL to a [SlideShare](https://www.slideshare.net/)
presentation and it will give you a PDF called `out.pdf`.
presentation and it will render it as a PDF.
I will clean this up, I promise.
@@ -11,5 +11,21 @@ I will clean this up, I promise.
pip install slideslurp
```
## Usage
```
usage: slideslurp [-h] [--output OUTPUT] url
Generate PDFs from Slideshare presentations
positional arguments:
url the URL to slurp
optional arguments:
-h, --help show this help message and exit
--output OUTPUT, -o OUTPUT
the file to write to (default: out.pdf)
```
<hr/>
Happy slurping!

View File

@@ -6,13 +6,13 @@ from setuptools import setup
setup(
name = 'slideslurp',
version = '0.0.3',
version = '0.0.4',
description = 'SlideShare to PDF',
author = 'Veit Heller',
author_email = 'veit@veitheller.de',
license = 'MIT License',
url = 'https://github.com/hellerve/slideslurp',
download_url = 'https://github.com/hellerve/slideslurp/tarball/0.0.3',
download_url = 'https://github.com/hellerve/slideslurp/tarball/0.0.4',
packages = find_packages('.'),
install_requires=[
"bs4",

View File

@@ -1,3 +1,4 @@
import argparse
import sys
import bs4
@@ -6,16 +7,25 @@ import requests
from reportlab.pdfgen import canvas
def main():
if not len(sys.argv) == 2:
print("Usage: slideslurp <url>")
sys.exit(1)
url = sys.argv[1]
def parse_args():
descr = "Generate PDFs from Slideshare presentations"
res = requests.get(url)
parser = argparse.ArgumentParser(description=descr)
parser.add_argument('url', metavar='url', nargs=1,
help='the URL to slurp')
parser.add_argument('--output', '-o', default='out.pdf',
help='the file to write to (default: out.pdf)')
return parser.parse_args()
def main():
args = parse_args()
res = requests.get(args.url)
tree = bs4.BeautifulSoup(res.text, "html.parser")
c = canvas.Canvas('out.pdf')
c = canvas.Canvas(args.file)
for img in tree.findAll("img", class_="slide_image"):
img_url = img.attrs["data-full"]