-
Notifications
You must be signed in to change notification settings - Fork 0
Blog Endpoints
This endpoint section is used for recommending blogs from the Soapbox marketing website based on specific categories. Note that blogs are tagged on the backend with the same categories as in this repository.
This is used for retrieving recommended blogs from the Soapbox marketing website. This works by passing in the categories you want to get recommendations from.
Here are the list of available categories: Communication, Growth, Motivation, or Work.
/blogs?first_category=<category>&second_category=<category>
-
first_category
: This works by passing it in theGET
request call with one of the valid categories. -
second_category
(optional): This works by passing it in theGET
request call with one of the valid categories. Please note this argument is optional.
[
{
"author": "Mike Arnone",
"categories": [
"Employee Motivation",
"Building Trust",
"Employee Engagement",
"Feedback"
],
"description": "Learn about the importance of employee recognition and how to build a culture of kudos within your organization.",
"image": "https://soapboxhq.com/wp-content/uploads/2019/07/employee-recognition-create-a-culture-of-kudos-in-the-workplace.jpg",
"link": "https://soapboxhq.com/blog/employee-motivation/employee-recognition-creating-a-culture-of-kudos",
"published_date": "2019-07-17T14:21:16+00:00",
"title": "Employee recognition: Creating a 'Culture of Kudos' | SoapBox"
},
{
"author": "Paige Magarrey",
"categories": [
"Communication",
"Employee Motivation",
"Employee Engagement",
"One-On-Ones"
],
"description": "Amazing managers swear by one-on-ones as the most important thing they do to lead their teams. Here are seven reasons why amazing managers do one-on-ones.",
"image": "https://soapboxhq.com/wp-content/uploads/2018/08/[email protected]",
"link": "https://soapboxhq.com/blog/communication/why-amazing-managers-do-one-on-ones",
"published_date": "2018-08-22T15:31:03+00:00",
"title": "7 Reasons Why Amazing Managers Do One-on-ones | SoapBox"
}
]
Here are the steps to fetch blog posts:
-
Ensure that Docker container is running.
-
If you only want to scrape actionable blogs, then hit the following endpoint:
/rescrape_blogs?only_actionable=true
, otherwise hit the following endpoint/rescrape_blogs
-
It may take a couple of minutes to get a response. If successful, you should receive the following response:
{
"Message": "Successfully re-scraped the blog"
}
-
Ensure that the Docker container is running.
-
Shell into the Docker container in a new terminal window using
sudo docker exec -it ml-api /bin/bash
. -
Run
cd api
. -
If you only want to scrape actionable blogs run
python3 get_blogs.py actionable
otherwise runpython3 get_blogs.py
.