json_metadata | "{"format": "markdown", "tags": ["coogger", "english", "coogger-python", "python", "tutorial"], "app": "coogger/1.4.1", "ecosystem": {"version": "1.4.1", "body": "<img gnrl=\"br-6\" src=\"https://www.coogger.com/media/images/coogger-python.png\"></img>\r\n\r\n[TOC]\r\n\r\n## Getting started\r\n\r\n#### Notes :\r\n- for now only authorized accounts can access the API service\r\n- [coogger-python on Github](https://github.com/coogger/coogger-python)\r\n\r\nInstall the package:\r\n\r\n```python\r\npip install coogger-python\r\n```\r\n\r\n## How to use coogger-python\r\n\r\nLet's include each class in our project, as below.\r\n\r\n```python\r\nfrom coogger.content import ContentApi, ContentFilterApi\r\nfrom coogger.user import SteemConnectUserApi, UserApi, UserFilterApi\r\nfrom coogger.ditop import DictToObject\r\n```\r\n\r\nyou can filter the contents you want to take with the following parameters.\r\n\r\n### ContentFilterApi\r\n\r\nThe **ContentFilterApi** class allows content to be filtered by any property.\r\n\r\n> Parameters\r\n- permlink\r\n- category\r\n- language\r\n- topic\r\n- status # shared / changed / approved /rejected\r\n- dor # duration of read\r\n- views\r\n- read\r\n- mod\r\n- cooggerup\r\n\r\n```python\r\n>>> content_filter_api = ContentFilterApi(username:str, sessionid:str, node:str)\r\nnode -> default = \"https://www.coogger.com/api/content/\"\r\nnode -> you can set \"http://127.0.0.1:8000/api/content/\" when you work local\r\n>>> filter_content = content_filter_api.filter(category=\"tutorial\", status=\"approved\", language=\"turkish\")\r\n>>> contents = content_filter_api.result\r\n>>> next_page = content_filter_api.next\r\n>>> previous_page = content_filter_api.previous\r\n>>> [content for content in contents]\r\n```\r\n\r\n### ContentApi\r\n\r\n**ContentApi** class is used to view or update a specific content.\r\n\r\n```python\r\n\r\n>>> content_api = ContentApi(username:str, permlink:str, sessionid:str, node:str)\r\nnode -> default -> \"https://www.coogger.com/api/content/{}/{}/\"\r\nsessionid -> default -> None\r\n>>> content_api.update(title=\"title\", category=\"category\", status=\"status\")\r\n\r\n```\r\n\r\n-----------\r\n\r\n### SteemConnectUserApi\r\n\r\nThe **SteemConnectUserApi** class is used to access SteemConnect User information, SteemConnectUserApi class is used to view or update a specific SteemConnect user,\r\n\r\n```python\r\n>>> steem_connect_user = SteemConnectUserApi(username:str, sessionid:str, node:str)\r\nnode -> default : \"http://www.coogger.com/api/steemconnectuser/@{}/\"\r\nsessionid -> default : None\r\n>>> user = steem_connect_user.get\r\n>>> user_update = steem_connect_user.update(access_token=\"new_access_token\")\r\n\r\n```\r\n\r\n### UserApi\r\nThe **UserApi** class is used to access user information, UserApi class is used to view or update a specific user.\r\n\r\n```python\r\n>>> user_api = UserApi(username:str, sessionid:str, node:str)\r\nnode -> default : \"http://www.coogger.com/api/user/@{}/\"\r\nsessionid -> default : None\r\n>>> user = user_api.get\r\n>>> user_update = user_api.update(about=\"hello\")\r\n\r\n```\r\n\r\n### UserFilterApi\r\n\r\nThe **UserFilterApi** class allows user to be filtered by any property.\r\n\r\n> Parameters\r\n- about\r\n- cooggerup_confirmation\r\n- cooggerup_percent\r\n- vote_percent\r\n- beneficiaries\r\n\r\n```python\r\n>>> user_filter_api = UserFilterApi(sessionid:str, node:str)\r\nnode -> default = \"https://www.coogger.com/api/user/\"\r\nnode -> you can set \"http://127.0.0.1:8000/api/user/\" when you work local\r\n>>> filter_user = user_filter_api.filter(cooggerup_confirmation=True, beneficiaries=10)\r\n>>> users = filter_user.result\r\n>>> next_page = filter_user.next\r\n>>> previous_page = filter_user.previous\r\n>>> [user for user in users]\r\n```"}}" |
---|