Skip to content

Commit

Permalink
Split up notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Oct 16, 2019
1 parent 72c2639 commit 50930d4
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 93 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ $ poetry install
Verify browser automation is working:

```
$ poetry run twerk check --debug
$ poetry run twerk check --debug --browser=chrome
$ poetry run twerk check --debug --browser=firefox
```

# Configuration
Expand Down
119 changes: 119 additions & 0 deletions notebooks/1_public_views.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from twerk.utils import get_browser\n",
"\n",
"browser = get_browser()\n",
"\n",
"browser.visit(\"http://example.com\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from twerk.utils import get_seed_username\n",
"\n",
"seed_username = get_seed_username()\n",
"\n",
"seed_username"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from twerk.views.public import Profile\n",
"\n",
"profile = Profile(browser, username=seed_username)\n",
"\n",
"profile"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.tweets"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.following"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.followers"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.likes"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.joined"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
92 changes: 0 additions & 92 deletions notebooks/playground.ipynb → notebooks/2_private_views.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,91 +23,6 @@
"browser.visit(\"http://example.com\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Public Views"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from twerk.utils import get_seed_username\n",
"\n",
"seed_username = get_seed_username()\n",
"\n",
"seed_username"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from twerk.views.public import Profile\n",
"\n",
"profile = Profile(browser, username=seed_username)\n",
"\n",
"profile"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.tweets"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.following"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.followers"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.likes"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"profile.joined"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Private Views"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -248,13 +163,6 @@
"source": [
"profile_report.cancel()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 50930d4

Please sign in to comment.