Skip to content

Commit

Permalink
feat: update template and fix error (status !) 200)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentLvr committed Oct 11, 2023
1 parent 1c55ccd commit 77bc867
Showing 1 changed file with 40 additions and 42 deletions.
82 changes: 40 additions & 42 deletions Buffer/Buffer_Create_draft.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@
},
{
"cell_type": "markdown",
"id": "e17e49b3-ec98-4ebb-831f-ade9ef8951e0",
"id": "3daa3956-b58a-476f-81ba-c3f3a35ece4c",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Parse cookies"
"### Create draft"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e356d2ed-3755-4682-9444-bb345aaa3e26",
"id": "7a31b1a2-e325-4943-9d14-23429e63b224",
"metadata": {
"papermill": {},
"tags": []
Expand All @@ -184,44 +184,10 @@
" data[key] = value\n",
" return data\n",
"\n",
"cookies = parse_cookie(cookie)"
]
},
{
"cell_type": "markdown",
"id": "2c979314-482d-4ead-94fa-b2c001637ca8",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Output"
]
},
{
"cell_type": "markdown",
"id": "3daa3956-b58a-476f-81ba-c3f3a35ece4c",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Create draft"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7a31b1a2-e325-4943-9d14-23429e63b224",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"def create_draft(buffer_url, cookies, text):\n",
"def create_draft(buffer_url, cookie, text):\n",
" # Init\n",
" result = None\n",
" cookies = parse_cookie(cookie)\n",
" profile_id = buffer_url.split(\"/profile/\")[-1].split(\"/\")[0]\n",
" \n",
" # Base URL\n",
Expand Down Expand Up @@ -266,13 +232,45 @@
" if res.status_code == 200:\n",
" result = res.json().get(\"result\")\n",
" else:\n",
" print(response.status_code)\n",
" print(response.text)\n",
" print(res.status_code)\n",
" print(res.text)\n",
" return result\n",
"\n",
"result = create_draft(buffer_url, cookies, text)\n",
"result"
]
},
{
"cell_type": "markdown",
"id": "2c979314-482d-4ead-94fa-b2c001637ca8",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Output"
]
},
{
"cell_type": "markdown",
"id": "3542ac38-b7a0-40c0-8ed0-12d4d5431b7a",
"metadata": {},
"source": [
"### Display result"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e356d2ed-3755-4682-9444-bb345aaa3e26",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"result"
]
}
],
"metadata": {
Expand Down Expand Up @@ -313,4 +311,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}

0 comments on commit 77bc867

Please sign in to comment.