Skip to content

Commit

Permalink
fix: seperated actor instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
varshakumarr committed Jul 10, 2024
1 parent 00a7844 commit f1a92ae
Showing 1 changed file with 74 additions and 50 deletions.
124 changes: 74 additions & 50 deletions Instagram/Instagram_Get_comments_from_post.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@
"id": "d40e70c0-a388-417b-a50f-c50bb82cc0b3",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-09T11:24:56.287151Z",
"iopub.status.busy": "2024-07-09T11:24:56.286708Z",
"iopub.status.idle": "2024-07-09T11:24:57.009265Z",
"shell.execute_reply": "2024-07-09T11:24:57.008625Z",
"shell.execute_reply.started": "2024-07-09T11:24:56.287072Z"
"iopub.execute_input": "2024-07-10T10:19:03.311545Z",
"iopub.status.busy": "2024-07-10T10:19:03.311176Z",
"iopub.status.idle": "2024-07-10T10:19:03.780108Z",
"shell.execute_reply": "2024-07-10T10:19:03.779578Z",
"shell.execute_reply.started": "2024-07-10T10:19:03.311479Z"
},
"papermill": {},
"tags": []
Expand Down Expand Up @@ -163,18 +163,18 @@
"id": "ce903236-60d1-4087-a31e-9321f2df6112",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-09T11:27:08.990532Z",
"iopub.status.busy": "2024-07-09T11:27:08.990077Z",
"iopub.status.idle": "2024-07-09T11:27:08.996063Z",
"shell.execute_reply": "2024-07-09T11:27:08.995332Z",
"shell.execute_reply.started": "2024-07-09T11:27:08.990491Z"
"iopub.execute_input": "2024-07-10T10:19:39.097039Z",
"iopub.status.busy": "2024-07-10T10:19:39.096822Z",
"iopub.status.idle": "2024-07-10T10:19:39.102435Z",
"shell.execute_reply": "2024-07-10T10:19:39.101844Z",
"shell.execute_reply.started": "2024-07-10T10:19:39.097018Z"
},
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"apify_token = \"apify_api_gXWnLEPiE7wC8ALUwQkJ0QcdbuQzU8xxxxxx\"\n",
"apify_token = \"apify_api_gXWnLEPiE7wC8ALUwQkJ0QcdbuQzU84xxxxx\"\n",
"post_url = \"https://www.instagram.com/p/Cn0cUc7KelU/\"\n",
"output_csv = f\"{post_url.split('https://www.instagram.com/')[1].replace('/', '_')}instagram_post_comments.csv\""
]
Expand All @@ -198,23 +198,21 @@
"tags": []
},
"source": [
"### Scrape post comments"
"### Use the actor created for task"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "legislative-taiwan",
"id": "9cf46b24-455a-404e-8d1a-b89ef33c36ea",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-09T11:24:57.016559Z",
"iopub.status.busy": "2024-07-09T11:24:57.016149Z",
"iopub.status.idle": "2024-07-09T11:25:14.526775Z",
"shell.execute_reply": "2024-07-09T11:25:14.524819Z",
"shell.execute_reply.started": "2024-07-09T11:24:57.016528Z"
},
"papermill": {},
"tags": []
"iopub.execute_input": "2024-07-10T10:19:03.789096Z",
"iopub.status.busy": "2024-07-10T10:19:03.788898Z",
"iopub.status.idle": "2024-07-10T10:19:04.494104Z",
"shell.execute_reply": "2024-07-10T10:19:04.493498Z",
"shell.execute_reply.started": "2024-07-10T10:19:03.789076Z"
}
},
"outputs": [],
"source": [
Expand All @@ -230,8 +228,34 @@
"run_details = response.json()\n",
"\n",
"# Extract the run ID\n",
"run_id = run_details['data']['id']\n",
"\n",
"run_id = run_details['data']['id']"
]
},
{
"cell_type": "markdown",
"id": "d7ca1899-b92b-4314-9025-975fdab2eb78",
"metadata": {},
"source": [
"### Scrape post comments"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "legislative-taiwan",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-10T10:19:04.495336Z",
"iopub.status.busy": "2024-07-10T10:19:04.495101Z",
"iopub.status.idle": "2024-07-10T10:19:15.967458Z",
"shell.execute_reply": "2024-07-10T10:19:15.966790Z",
"shell.execute_reply.started": "2024-07-10T10:19:04.495306Z"
},
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"# Define the URL to fetch the actor run status\n",
"run_status_url = f\"https://api.apify.com/v2/acts/apify~instagram-comment-scraper/runs/{run_id}?token={apify_token}\"\n",
"\n",
Expand Down Expand Up @@ -266,15 +290,15 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "01deb84d-abd7-4975-ab77-973fe84acf0f",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-09T11:25:14.527895Z",
"iopub.status.busy": "2024-07-09T11:25:14.527683Z",
"iopub.status.idle": "2024-07-09T11:25:14.536296Z",
"shell.execute_reply": "2024-07-09T11:25:14.535520Z",
"shell.execute_reply.started": "2024-07-09T11:25:14.527870Z"
"iopub.execute_input": "2024-07-10T10:19:15.968698Z",
"iopub.status.busy": "2024-07-10T10:19:15.968360Z",
"iopub.status.idle": "2024-07-10T10:19:15.972479Z",
"shell.execute_reply": "2024-07-10T10:19:15.971913Z",
"shell.execute_reply.started": "2024-07-10T10:19:15.968671Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -321,15 +345,15 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"id": "c7ac65a4-dd93-43c4-8090-c86a2aa28898",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-09T11:26:04.217728Z",
"iopub.status.busy": "2024-07-09T11:26:04.217462Z",
"iopub.status.idle": "2024-07-09T11:26:04.239367Z",
"shell.execute_reply": "2024-07-09T11:26:04.238673Z",
"shell.execute_reply.started": "2024-07-09T11:26:04.217689Z"
"iopub.execute_input": "2024-07-10T10:19:15.973674Z",
"iopub.status.busy": "2024-07-10T10:19:15.973347Z",
"iopub.status.idle": "2024-07-10T10:19:16.091984Z",
"shell.execute_reply": "2024-07-10T10:19:16.091477Z",
"shell.execute_reply.started": "2024-07-10T10:19:15.973645Z"
},
"tags": []
},
Expand Down Expand Up @@ -369,7 +393,7 @@
" <td>17858772584879006</td>\n",
" <td>Promote it on @writing._.skill</td>\n",
" <td>aditya__.7443</td>\n",
" <td>https://instagram.fkul21-2.fna.fbcdn.net/v/t51...</td>\n",
" <td>https://scontent-lhr8-2.cdninstagram.com/v/t51...</td>\n",
" <td>2023-01-25T01:20:12.000Z</td>\n",
" <td>0</td>\n",
" </tr>\n",
Expand All @@ -378,7 +402,7 @@
" <td>17842757270932646</td>\n",
" <td>Promote at @Thewriters_heaven</td>\n",
" <td>skylarsrwriter</td>\n",
" <td>https://instagram.fkul21-2.fna.fbcdn.net/v/t51...</td>\n",
" <td>https://scontent-lhr8-2.cdninstagram.com/v/t51...</td>\n",
" <td>2023-01-25T01:22:15.000Z</td>\n",
" <td>0</td>\n",
" </tr>\n",
Expand All @@ -387,7 +411,7 @@
" <td>17945160482350602</td>\n",
" <td>@Its_chetram_4444</td>\n",
" <td>skylarsrwriter</td>\n",
" <td>https://instagram.fkul21-2.fna.fbcdn.net/v/t51...</td>\n",
" <td>https://scontent-lhr8-2.cdninstagram.com/v/t51...</td>\n",
" <td>2023-01-25T01:22:22.000Z</td>\n",
" <td>0</td>\n",
" </tr>\n",
Expand All @@ -396,7 +420,7 @@
" <td>18007951324553277</td>\n",
" <td>Promote at @TheAuthors.World 💫</td>\n",
" <td>author__mack16</td>\n",
" <td>https://instagram.fkul21-2.fna.fbcdn.net/v/t51...</td>\n",
" <td>https://scontent-lhr6-2.cdninstagram.com/v/t51...</td>\n",
" <td>2023-01-25T01:24:59.000Z</td>\n",
" <td>0</td>\n",
" </tr>\n",
Expand All @@ -412,10 +436,10 @@
"3 18007951324553277 Promote at @TheAuthors.World 💫 author__mack16 \n",
"\n",
" PROFILE_PICTURE \\\n",
"0 https://instagram.fkul21-2.fna.fbcdn.net/v/t51... \n",
"1 https://instagram.fkul21-2.fna.fbcdn.net/v/t51... \n",
"2 https://instagram.fkul21-2.fna.fbcdn.net/v/t51... \n",
"3 https://instagram.fkul21-2.fna.fbcdn.net/v/t51... \n",
"0 https://scontent-lhr8-2.cdninstagram.com/v/t51... \n",
"1 https://scontent-lhr8-2.cdninstagram.com/v/t51... \n",
"2 https://scontent-lhr8-2.cdninstagram.com/v/t51... \n",
"3 https://scontent-lhr6-2.cdninstagram.com/v/t51... \n",
"\n",
" TIMESTAMP LIKES_COUNT \n",
"0 2023-01-25T01:20:12.000Z 0 \n",
Expand All @@ -424,7 +448,7 @@
"3 2023-01-25T01:24:59.000Z 0 "
]
},
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -457,15 +481,15 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "be26e796-6c38-4152-a0b8-49f51b617a6f",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-09T11:25:14.714352Z",
"iopub.status.busy": "2024-07-09T11:25:14.714084Z",
"iopub.status.idle": "2024-07-09T11:25:14.937278Z",
"shell.execute_reply": "2024-07-09T11:25:14.936639Z",
"shell.execute_reply.started": "2024-07-09T11:25:14.714319Z"
"iopub.execute_input": "2024-07-10T10:19:16.093061Z",
"iopub.status.busy": "2024-07-10T10:19:16.092841Z",
"iopub.status.idle": "2024-07-10T10:19:16.219821Z",
"shell.execute_reply": "2024-07-10T10:19:16.219349Z",
"shell.execute_reply.started": "2024-07-10T10:19:16.093031Z"
},
"tags": []
},
Expand Down

0 comments on commit f1a92ae

Please sign in to comment.