Skip to content

Commit

Permalink
fix: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentLvr committed Nov 22, 2023
1 parent 2a26546 commit 343ca93
Showing 1 changed file with 12 additions and 70 deletions.
82 changes: 12 additions & 70 deletions Google Search/Google_Search_Find_Images_link.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tags": []
},
"source": [
"**Tags:** #google #search #images #link #find #python"
"**Tags:** #googlesearch #images #link #find #python"
]
},
{
Expand Down Expand Up @@ -63,7 +63,7 @@
"tags": []
},
"source": [
"**Description:** This notebook will demonstrate how to use Google Search to find images link. It is useful for organizations to quickly find images link for their website or blog."
"**Description:** This notebook will demonstrate how to use Google Search to find images link."
]
},
{
Expand Down Expand Up @@ -103,57 +103,36 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "ba3dbe0e-d857-432d-9eef-40e18253653e",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-16T05:18:26.502745Z",
"iopub.status.busy": "2023-11-16T05:18:26.502474Z",
"iopub.status.idle": "2023-11-16T05:18:28.424101Z",
"shell.execute_reply": "2023-11-16T05:18:28.423473Z",
"shell.execute_reply.started": "2023-11-16T05:18:26.502673Z"
},
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"import requests\n",
"import naas"
"import naas\n",
"import requests"
]
},
{
"cell_type": "markdown",
"id": "4b7a8f50-760f-4abf-912a-f8db642f0f92",
"metadata": {},
"source": [
"### Setup variables"
]
},
{
"cell_type": "markdown",
"id": "27869816-bf38-4224-8a42-effe3d75713e",
"metadata": {},
"source": [
"### Setup variables\n",
"- `API_KEY`: API key from Google Cloud Platform.\n",
"- `CSE_ID`: CSE ID from Programmable Search Engine.\n",
"- `query`: Represents the search query or term.\n",
"- `query`: Represents the search query.\n",
"- `limit`: Represents the maximum number of search results to be returned.\n",
"- `start_index`: Assigned the integer value `1`. Represents the starting index of the search results."
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "07fbeb5e-3eaf-4bcd-bf13-a648cac8e1a1",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-16T05:18:28.425918Z",
"iopub.status.busy": "2023-11-16T05:18:28.425653Z",
"iopub.status.idle": "2023-11-16T05:18:28.619506Z",
"shell.execute_reply": "2023-11-16T05:18:28.618908Z",
"shell.execute_reply.started": "2023-11-16T05:18:28.425887Z"
},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -213,16 +192,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "3b8ec91e-2cf0-4ed5-a2ba-c628115fdf31",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-16T05:18:28.621166Z",
"iopub.status.busy": "2023-11-16T05:18:28.620704Z",
"iopub.status.idle": "2023-11-16T05:18:28.626269Z",
"shell.execute_reply": "2023-11-16T05:18:28.625777Z",
"shell.execute_reply.started": "2023-11-16T05:18:28.621131Z"
},
"papermill": {},
"tags": []
},
Expand Down Expand Up @@ -264,22 +236,7 @@
"tags": []
},
"source": [
"### Display result"
]
},
{
"cell_type": "markdown",
"id": "3c4aa789-8fe5-4f36-85f1-483777c0efbe",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-15T15:06:51.242286Z",
"iopub.status.busy": "2023-11-15T15:06:51.242043Z",
"iopub.status.idle": "2023-11-15T15:06:51.252616Z",
"shell.execute_reply": "2023-11-15T15:06:51.251573Z",
"shell.execute_reply.started": "2023-11-15T15:06:51.242261Z"
}
},
"source": [
"### Display result\n",
"- While limit is more than zero, iterate through.\n",
"- Calls the `get_google_images` function and places the returned data in variable \"data\".\n",
"- Print image links with the `print_image_links`function.\n",
Expand All @@ -290,28 +247,13 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "a63721db-baba-416d-8ef7-8be84327c38b",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-16T05:18:28.627470Z",
"iopub.status.busy": "2023-11-16T05:18:28.627195Z",
"iopub.status.idle": "2023-11-16T05:18:28.856903Z",
"shell.execute_reply": "2023-11-16T05:18:28.856241Z",
"shell.execute_reply.started": "2023-11-16T05:18:28.627439Z"
},
"papermill": {},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"No image results found.\n"
]
}
],
"outputs": [],
"source": [
"while limit > 0:\n",
" data = get_google_images(API_KEY, CSE_ID, query, start_index)\n",
Expand Down

0 comments on commit 343ca93

Please sign in to comment.