পোস্ট: অনুসন্ধান
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
প্রদত্ত ক্যোয়ারী পদের সাথে মেলে এমন একটি পোস্টের জন্য অনুসন্ধান করে৷ এখন এটি চেষ্টা করুন বা একটি উদাহরণ দেখুন ।
সার্চ করা ব্লগ ব্যক্তিগত হলে অনুমোদনের প্রয়োজন হবে।
অনুরোধ
HTTP অনুরোধ
GET https://www.googleapis.com/blogger/v3/blogs/blogId/posts/search
পরামিতি
পরামিতি নাম | মান | বর্ণনা |
---|
প্রয়োজনীয় পরামিতি |
blogId | string | ব্লগের আইডি সার্চ করতে হবে। |
q | string | অনুসন্ধান করার জন্য ক্যোয়ারী পদ। |
ঐচ্ছিক পরামিতি |
fetchBodies | boolean | পোস্টের মূল বিষয়বস্তু অন্তর্ভুক্ত কিনা। ট্র্যাফিক কমাতে, পোস্টের মূল বিষয়বস্তুর প্রয়োজন না হলে এই প্যারামিটারটিকে মিথ্যাতে সেট করুন। (ডিফল্ট: true ) |
orderBy | string | সার্চ ফলাফলে প্রয়োগকৃত সাজানোর ক্রম।
গ্রহণযোগ্য মান হল:- "
published ": পোস্টটি প্রকাশিত হওয়ার তারিখ অনুসারে অর্ডার করুন - "
updated ": পোস্টটি সর্বশেষ আপডেট হওয়ার তারিখের মধ্যে অর্ডার করুন
|
শরীরের অনুরোধ
এই পদ্ধতির সাথে একটি অনুরোধ সংস্থা সরবরাহ করবেন না।
প্রতিক্রিয়া
সফল হলে, এই পদ্ধতিটি নিম্নলিখিত কাঠামো সহ একটি প্রতিক্রিয়া বডি প্রদান করে:
{
"kind": "blogger#postList",
"nextPageToken": string,
"items": [
posts Resource
]
}
সম্পত্তির নাম | মান | বর্ণনা | নোট |
---|
kind | string | এই ধরনের সত্তা. সর্বদা blogger#postList | |
nextPageToken | string | পরের পৃষ্ঠাটি আনতে পৃষ্ঠা সংখ্যা টোকেন, যদি একটি বিদ্যমান থাকে। | |
items[] | list | এই ব্লগের জন্য পোস্ট তালিকা. | |
উদাহরণ
দ্রষ্টব্য: এই পদ্ধতির জন্য উপলব্ধ কোড উদাহরণগুলি সমস্ত সমর্থিত প্রোগ্রামিং ভাষার প্রতিনিধিত্ব করে না (সমর্থিত ভাষার তালিকার জন্য ক্লায়েন্ট লাইব্রেরি পৃষ্ঠা দেখুন)।
জাভা
জাভা ক্লায়েন্ট লাইব্রেরি ব্যবহার করে
// The BlogId for the http://buzz.blogger.com/ blog.
String BUZZ_BLOG_ID = "2399953";
// Configure the Java API Client for Installed Native App
HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();
// Configure the Installed App OAuth2 flow.
Credential credential = OAuth2Native.authorize(HTTP_TRANSPORT,
JSON_FACTORY, new LocalServerReceiver(),
Arrays.asList(BloggerScopes.BLOGGER));
// Construct the Blogger API access facade object.
Blogger blogger = Blogger.builder(HTTP_TRANSPORT, JSON_FACTORY)
.setApplicationName("Blogger-PostsSearch-Snippet/1.0")
.setHttpRequestInitializer(credential).build();
// The request action.
Search postsSearchAction = blogger.posts().search(BUZZ_BLOG_ID);
postsSearchAction.setQ("threaded comments");
// Restrict the result content to just the data we need.
postsSearchAction.setFields("items(content,published,title,url)");
// This step sends the request to the server.
PostList posts = postsSearchAction.execute();
// Now we can navigate the response.
if (posts.getItems() != null && !posts.getItems().isEmpty()) {
for (Post post : posts.getItems()) {
System.out.println("Title: " + post.getTitle());
System.out.println("Published: " + post.getPublished());
System.out.println("URL: " + post.getUrl());
System.out.println("Content: " + post.getContent());
}
}
এটা চেষ্টা করুন!
লাইভ ডেটাতে এই পদ্ধতিতে কল করতে এবং প্রতিক্রিয়া দেখতে নীচের APIs এক্সপ্লোরার ব্যবহার করুন।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2024-11-06 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2024-11-06 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eSearches blog posts matching specified query terms within a given blog.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization for private blogs and allows customization of search results through optional parameters like \u003ccode\u003efetchBodies\u003c/code\u003e and \u003ccode\u003eorderBy\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eReturns a list of posts with metadata, including title, URL, and content (if requested), alongside pagination information.\u003c/p\u003e\n"],["\u003cp\u003eProvides code examples for utilizing this functionality with the Java client library.\u003c/p\u003e\n"],["\u003cp\u003eOffers an interactive API explorer to test the method with live data.\u003c/p\u003e\n"]]],[],null,["# Posts: search\n\nSearches for a post that matches the given query terms.\n[Try it now](#try-it) or [see an example](#examples).\n\n[Authorization](/blogger/docs/3.0/using#auth) will be required if the blog being searched is private.\n\nRequest\n-------\n\n### HTTP request\n\n```\nGET https://www.googleapis.com/blogger/v3/blogs/blogId/posts/search\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Required parameters** |||\n| `blogId` | `string` | The ID of the blog to search in. |\n| `q` | `string` | Query terms to search for. |\n| **Optional parameters** |||\n| `fetchBodies` | `boolean` | Whether the body content of posts is included. To minimize traffic, set this parameter to false when the post's body content is not required. (Default: `true`) |\n| `orderBy` | `string` | The sort order applied to the search results. \u003cbr /\u003e \u003cbr /\u003e Acceptable values are: - \"`published`\": Order by the date the post was published - \"`updated`\": Order by the date the post was last updated |\n\n### Request body\n\nDo not supply a request body with this method.\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure:\n\n```objective-c\n{\n \"kind\": \"blogger#postList\",\n \"nextPageToken\": string,\n \"items\": [\n posts Resource\n ]\n}\n```\n\n| Property name | Value | Description | Notes |\n|-----------------|----------|---------------------------------------------------------|-------|\n| `kind` | `string` | The kind of this entity. Always `blogger#postList` | |\n| `nextPageToken` | `string` | Pagination token to fetch the next page, if one exists. | |\n| `items[]` | `list` | The list of Posts for this Blog. | |\n\nExamples\n--------\n\n**Note:** The code examples available for this method do not represent all supported programming languages (see the [client libraries page](/blogger/docs/3.0/libraries) for a list of supported languages). \n\n### Java\n\nUses the [Java client library](http://code.google.com/p/google-api-java-client/) \n\n```java\n// The BlogId for the http://buzz.blogger.com/ blog.\nString BUZZ_BLOG_ID = \"2399953\";\n\n// Configure the Java API Client for Installed Native App\nHttpTransport HTTP_TRANSPORT = new NetHttpTransport();\nJsonFactory JSON_FACTORY = new JacksonFactory();\n\n// Configure the Installed App OAuth2 flow.\nCredential credential = OAuth2Native.authorize(HTTP_TRANSPORT,\n\tJSON_FACTORY, new LocalServerReceiver(),\n\tArrays.asList(BloggerScopes.BLOGGER));\n\n// Construct the Blogger API access facade object.\nBlogger blogger = Blogger.builder(HTTP_TRANSPORT, JSON_FACTORY)\n\t.setApplicationName(\"Blogger-PostsSearch-Snippet/1.0\")\n\t.setHttpRequestInitializer(credential).build();\n\n// The request action.\nSearch postsSearchAction = blogger.posts().search(BUZZ_BLOG_ID);\npostsSearchAction.setQ(\"threaded comments\");\n\n// Restrict the result content to just the data we need.\npostsSearchAction.setFields(\"items(content,published,title,url)\");\n\n// This step sends the request to the server.\nPostList posts = postsSearchAction.execute();\n\n// Now we can navigate the response.\nif (posts.getItems() != null && !posts.getItems().isEmpty()) {\n\tfor (Post post : posts.getItems()) {\n\t\tSystem.out.println(\"Title: \" + post.getTitle());\n\t\tSystem.out.println(\"Published: \" + post.getPublished());\n\t\tSystem.out.println(\"URL: \" + post.getUrl());\n\t\tSystem.out.println(\"Content: \" + post.getContent());\n\t}\n}\n```\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]