Notebooks >> Scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

153 lines
4.7 KiB

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "d1a0256a-ff3e-4aad-9e6f-f4267db5175b",
"metadata": {},
"outputs": [],
"source": [
"!pip install photon\n"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "3efdc58b-bf19-4138-b75c-afa610af01d5",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Exception in thread Thread-41 (jscanner):\n",
"Traceback (most recent call last):\n",
" File \"/opt/conda/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n",
" self.run()\n",
" File \"/opt/conda/lib/python3.10/threading.py\", line 953, in run\n",
" self._target(*self._args, **self._kwargs)\n",
" File \"/home/jovyan/.local/lib/python3.10/site-packages/photon/photon.py\", line 208, in jscanner\n",
" response = requester(url, delay, domain_name, user_agents, cookie, timeout) # make request to the url\n",
" File \"/home/jovyan/.local/lib/python3.10/site-packages/photon/photon.py\", line 58, in requester\n",
" if 'text/html' in response.headers['content-type']:\n",
" File \"/opt/conda/lib/python3.10/site-packages/requests/structures.py\", line 52, in __getitem__\n",
" return self._store[key.lower()][1]\n",
"KeyError: 'content-type'\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'custom': [],\n",
" 'endpoints': ['https://caddyserver.com',\n",
" 'https://twitter.com/githubstatus',\n",
" 'http://www.w3.org/1999/xhtml',\n",
" 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd',\n",
" 'https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194',\n",
" 'https://help.github.com/pages/',\n",
" 'http://www.w3.org/1999/xlink',\n",
" 'http://www.w3.org/2000/svg',\n",
" 'https://githubstatus.com',\n",
" 'https://www.iana.org/domains/example'],\n",
" 'external': ['https://www.iana.org/domains/example'],\n",
" 'failed': [],\n",
" 'files': [],\n",
" 'fuzzable': [],\n",
" 'intel': ['select2@4.1.0-rc.0'],\n",
" 'internal': ['https://homelab.donavanaldrich.com/#/home/links',\n",
" 'http://example.com',\n",
" 'https://donavanaldrich.com/api',\n",
" 'https://raw.githubusercontent.com/awesome-selfhosted/awesome-selfhosted/master/README.md'],\n",
" 'keys': [],\n",
" 'robots': [],\n",
" 'scripts': ['https://raw.githubusercontent.com/awesome-selfhosted/awesome-selfhosted/master/README.md/api-selector.js',\n",
" 'http://example.com/api-selector.js',\n",
" 'https://homelab.donavanaldrich.com/#/home/links/api-selector.js',\n",
" 'https://donavanaldrich.com/api/api-selector.js']}\n"
]
}
],
"source": [
"# import photon\n",
"# result = photon.crawl('https://donavanaldrich.com/api')\n",
"# print(result.results())\n",
"\n",
"import photon\n",
"import pprint\n",
"results = photon.crawl('https://homelab.donavanaldrich.com/#/home/links')\n",
"pprint.pprint(results)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "564f5e9c-dfe8-46a1-a9fc-4c5a5e5781bb",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"my_value = os.environ[\"MY_ENVIRONMENT_VARIABLE\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f0d0b4d4",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "60d3a171",
"metadata": {},
"outputs": [],
"source": [
"%lsmagic"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "009fc04c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
},
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}