-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c629023
commit 1c55ccd
Showing
1 changed file
with
241 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,241 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "3d064ccd-ca27-4d34-85f6-84ce63dcc206", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"<img width=\"10%\" alt=\"Naas\" src=\"https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160\"/>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "fe7f0846-ce7f-43c9-8202-a90b9e29cd4c", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"# Buffer - Send text to Idea" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "c0403ba8-62ef-4413-94d4-5b225a4ae7ac", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"**Tags:** #buffer #idea #text #send #python #api" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "d295e708-adaa-45b8-911e-976451f36f80", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"**Author:** [Florent Ravenel](https://www.linkedin.com/in/florent-ravenel/)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "03594f2a-572a-4303-9161-c8e6b6d42f17", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"**Last update:** 2023-10-11 (Created: 2023-10-11)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "61edbaba-cd8f-43f2-b956-247d2408756f", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"**Description:** This notebook will show how to send text to Idea using the Buffer API. It is usefull for organizations that need to quickly send text to Idea." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "633cba7e-6805-4f74-bfb7-a57f316a1958", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"**References:**\n- [Buffer API Documentation](https://buffer.com/developers/api/overview)\n- [Buffer Python Library](https://github.com/bufferapp/buffer-python)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "dd7865b3-eb7b-4755-9929-54ae4355ac46", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"## Input" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "9db307ec-534b-47b4-a606-6cf4e9213d24", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"### Import libraries" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "9de34e94-bcf2-40c1-8970-6a7e07f4917b", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": "import buffer", | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ad728d7a-2f44-4cf6-af85-20b48336ba49", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"### Setup variables\n- **access_token**: Access token to use the Buffer API. [Get your access token](https://buffer.com/developers/api/overview)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "9f30fb5e-a068-4f2c-af42-c6c7c917d40f", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": "access_token = \"YOUR_ACCESS_TOKEN\"", | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "bf29c888-784f-4427-9a1b-0161fcdd8246", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"## Model" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "090529fe-160d-4099-bfd1-e19fe6356777", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"### Send text to Idea" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "0df9260c-b899-4666-ad12-1dd2ece7124b", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"This function will send text to Idea using the Buffer API." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "6e09f56c-9254-432f-afdf-5674f16b18aa", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": "def send_text_to_idea(text):\n # Create a Buffer client\n client = buffer.Buffer(access_token)\n # Create a post\n post = buffer.Post(text=text)\n # Send the post to Idea\n client.create_update(post, service=\"idea\")", | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "9ef12d0f-2efe-4163-90a9-2ec9206c2ce5", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"## Output" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "bf514ffc-32f8-4b57-be27-36c4dfe7f693", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"### Display result" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0b478a6e-8cf3-4984-8cd1-f2af23f73462", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [] | ||
}, | ||
"source": "send_text_to_idea(\"This is a test\")", | ||
"outputs": [] | ||
} | ||
], | ||
"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.9.6" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
"state": {}, | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |