# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['sneakpeek']

package_data = \
{'': ['*']}

install_requires = \
['beautifulsoup4>=4.11.1,<5.0.0',
 'click>=8.1.3,<9.0.0',
 'fastapi>=0.79.0,<0.80.0',
 'rich>=12.5.1,<13.0.0',
 'tweepy>=4.10.0,<5.0.0',
 'uvicorn>=0.18.2,<0.19.0',
 'validators>=0.20.0,<0.21.0']

entry_points = \
{'console_scripts': ['sneakpeek = sneakpeek.console:cli']}

setup_kwargs = {
    'name': 'sneakpeek',
    'version': '0.8.0',
    'description': 'A python module to generate link previews.',
    'long_description': '\n<div align="center">\n  <h1>\n    SneakPeek\n  </h1>\n  <h4>A python module and a minimalistic server to generate link previews.</h4>\n</div>\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://pepy.tech/badge/sneakpeek)](https://pepy.tech/project/sneakpeek)\n[![PyPI](https://img.shields.io/pypi/v/sneakpeek)](https://pypi.org/project/sneakpeek)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sneakpeek)](https://pypi.org/project/sneakpeek)\n[![test-ci](https://img.shields.io/github/workflow/status/codingcoffee/sneakpeek/test-ci)](https://github.com/codingCoffee/sneakpeek/actions)\n[![Docker Pulls](https://img.shields.io/docker/pulls/codingcoffee/sneakpeek)](https://hub.docker.com/r/codingcoffee/sneakpeek)\n[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/codingcoffee/sneakpeek/latest)](https://hub.docker.com/r/codingcoffee/sneakpeek)\n\n## What is supported\n\n- Any page which supports [Open Graph Protocol](https://ogp.me) (which most sane websites do)\n- Special handling for sites like\n  - [Twitter](https://twitter.com) (requires a twitter [API key](https://developer.twitter.com/))\n\n\n## Installation\n\nRun the following to install\n\n```sh\npip install sneakpeek\n```\n\n\n## Usage as a Python Module\n\n### From a URL\n\n```sh\n>>> import sneakpeek\n>>> from pprint import pprint\n\n>>> link = sneakpeek.SneakPeek("https://www.youtube.com/watch?v=dQw4w9WgXcQ")\n>>> link.fetch()\n>>> link.is_valid()\nTrue\n>>> pprint(link)\n{\'description\': \'The official video for “Never Gonna Give You Up” by Rick \'\n                \'AstleyTaken from the album ‘Whenever You Need Somebody’ – \'\n                \'deluxe 2CD and digital deluxe out 6th May ...\',\n \'domain\': \'www.youtube.com\',\n \'image\': \'https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg\',\n \'image:height\': \'720\',\n \'image:width\': \'1280\',\n \'scrape\': False,\n \'site_name\': \'YouTube\',\n \'title\': \'Rick Astley - Never Gonna Give You Up (Official Music Video)\',\n \'type\': \'video.other\',\n \'url\': \'https://www.youtube.com/watch?v=dQw4w9WgXcQ\',\n \'video:height\': \'720\',\n \'video:secure_url\': \'https://www.youtube.com/embed/dQw4w9WgXcQ\',\n \'video:tag\': \'never gonna give you up karaoke\',\n \'video:type\': \'text/html\',\n \'video:url\': \'https://www.youtube.com/embed/dQw4w9WgXcQ\',\n \'video:width\': \'1280\'}\n\n>>> link = sneakpeek.SneakPeek(url="https://codingcoffee.dev")\n>>> link.fetch()\n>>> pprint(link)\n{\'description\': \'A generalist with multi faceted interests and extensive \'\n                \'experience with DevOps, System Design and Full Stack \'\n                \'Development. I like blogging about things which interest me, \'\n                \'have a niche for optimizing and customizing things to the \'\n                \'very last detail, this includes my text editor and operating \'\n                \'system alike.\',\n \'domain\': \'codingcoffee.dev\',\n \'image\': \'https://www.gravatar.com/avatar/7ecdc5e1441ecd501faaf42a6ab9d6c0?s=200\',\n \'scrape\': False,\n \'title\': \'Ameya Shenoy\',\n \'type\': \'website\',\n \'url\': \'https://codingcoffee.dev\'}\n```\n\nUse `scrape=True` to fetch data using scraping instead of relying on open graph tags\n\n```sh\n>>> link = sneakpeek.SneakPeek(url="https://news.ycombinator.com/item?id=23812063", scrape=True)\n>>> link.fetch()\n>>> pprint(link)\n{\'description\': \'\',\n \'domain\': \'news.ycombinator.com\',\n \'image\': \'y18.gif\',\n \'scrape\': True,\n \'title\': \'WireGuard as VPN Server on Kubernetes with AdBlocking | Hacker News\',\n \'type\': \'other\',\n \'url\': \'https://news.ycombinator.com/item?id=23812063\'}\n ```\n\n### From HTML\n\n```\n>>> HTML = """\n... <html xmlns:og="http://ogp.me/ns">\n... <head>\n... <title>The Rock (1996)</title>\n... <meta property="og:title" content="The Rock" />\n... <meta property="og:description" content="The Rock: Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris, John Spencer. A mild-mannered chemist and an ex-con must lead the counterstrike when a rogue group of military men, led by a renegade general, threaten a nerve gas attack from Alcatraz against San Francisco.">\n... <meta property="og:type" content="movie" />\n... <meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />\n... <meta property="og:image" content="https://m.media-amazon.com/images/M/MV5BZDJjOTE0N2EtMmRlZS00NzU0LWE0ZWQtM2Q3MWMxNjcwZjBhXkEyXkFqcGdeQXVyNDk3NzU2MTQ@._V1_FMjpg_UX1000_.jpg">\n... </head>\n... </html>\n... """\n>>> movie = sneakpeek.SneakPeek(html=HTML)\n>>> movie.is_valid()\nTrue\n>>> pprint(movie)\n{\'description\': \'The Rock: Directed by Michael Bay. With Sean Connery, Nicolas \'\n                \'Cage, Ed Harris, John Spencer. A mild-mannered chemist and an \'\n                \'ex-con must lead the counterstrike when a rogue group of \'\n                \'military men, led by a renegade general, threaten a nerve gas \'\n                \'attack from Alcatraz against San Francisco.\',\n \'domain\': None,\n \'image\': \'https://m.media-amazon.com/images/M/MV5BZDJjOTE0N2EtMmRlZS00NzU0LWE0ZWQtM2Q3MWMxNjcwZjBhXkEyXkFqcGdeQXVyNDk3NzU2MTQ@._V1_FMjpg_UX1000_.jpg\',\n \'scrape\': False,\n \'title\': \'The Rock\',\n \'type\': \'movie\',\n \'url\': \'http://www.imdb.com/title/tt0117500/\'}\n```\n\n\n## Usage as a Server\n\nA simple server using FastAPI and uvicorn is used to serve the requests.\n\n```sh\nsneekpeek serve\n```\n\nYou can view the docs at http://localhost:9000/docs\n\n\n## Usage as a CLI\n\n```\nsneakpeek preview --url "https://github.com/codingcoffee/" | jq\n{\n  "domain": "github.com",\n  "scrape": false,\n  "url": "https://github.com/codingCoffee",\n  "title": "codingCoffee - Overview",\n  "type": "profile",\n  "image": "https://avatars.githubusercontent.com/u/13611153?v=4?s=400",\n  "description": "Automate anything and everything 🙋\u200d♂️. codingCoffee has 68 repositories available. Follow their code on GitHub.",\n  "error": null,\n  "image:alt": "Automate anything and everything 🙋\u200d♂️. codingCoffee has 68 repositories available. Follow their code on GitHub.",\n  "site_name": "GitHub"\n}\n```\n\n## Docker\n\n### As a Server\n\n```sh\ndocker run -it --rm -p 9000:9000 codingcoffee/sneakpeek -- serve --host 0.0.0.0\n```\n\n### As a CLI\n\n```sh\ndocker run -it --rm -p 9000:9000 codingcoffee/sneakpeek -- preview --url "https://github.com/codingcoffee"\n```\n\n\n## Configuration\n\n### Twitter\n\n- Sign up for a developer account on twitter [here](https://developer.twitter.com/)\n- Create an app\n- Add the following variables as ENV vars\n\n\n```\nTWITTER_CONSUMER_KEY="sample"\nTWITTER_CONSUMER_SECRET="sample"\nTWITTER_ACCESS_TOKEN="sample"\nTWITTER_ACCESS_TOKEN_SECRET="sample"\n```\n\n\n## Development\n\n```\npip install -U poetry\ngit clone https://github.com/codingcoffee/sneakpeek\ncd sneakpeek\npoetry install\n```\n\n\n## Running Tests\n\n```sh\npoetry run pytest\n```\n\n- Tested Websites\n  - [x] [YouTube](https://youtube.com)\n  - [x] [GitHub](https://github.com)\n  - [x] [LinkedIN](https://linkedin.com)\n  - [x] [Reddit](https://reddit.com)\n  - [x] [StackOverflow](https://stackoverflow.com)\n  - [x] [Business Insider](https://www.businessinsider.in)\n  - [x] [HackerNews](https://news.ycombinator.com/)\n  - [x] [Twitter](https://twitter.com)\n\n\n## TODO\n\n- [ ] [Instagram](https://instagram.com) (using [instagram-scraper](https://github.com/arc298/instagram-scraper))\n- [ ] [Facebook](https://facebook.com)\n- [ ] CI/CD for publishing to PyPi\n\n\n## Contribution\n\nHave better suggestions to optimize the server image? Found some typos? Need special handling for a new website? Found a bug? Go ahead and create an [Issue](https://github.com/codingcoffee/sneakpeek/issues)! Contributions of any kind welcome!\n\nWant to work on a TODO? Its always a good idea to talk about what are going to do before you actually start it, so frustration can be avoided.\n\nSome rules for coding:\n\n- Use the code style the project uses\n- For each feature, make a seperate branch, so it can be reviewed separately\n- Use commits with a good description, so everyone can see what you did\n\n\n## License\n\nThe code in this repository has been released under the [MIT License](https://opensource.org/licenses/MIT)\n\n',
    'author': 'Ameya Shenoy',
    'author_email': 'shenoy.ameya@gmail.com',
    'maintainer': 'Ameya Shenoy',
    'maintainer_email': 'shenoy.ameya@gmail.com',
    'url': 'https://github.com/codingcoffee/sneakpeek',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
