feat: modify scrape api to support html
This commit is contained in:
@@ -28,15 +28,24 @@ export const getStoredRecordings = async (): Promise<string[] | null> => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createMarkdownRobot = async (url: string, name?: string): Promise<any> => {
|
export const createScrapeRobot = async (
|
||||||
|
url: string,
|
||||||
|
name?: string,
|
||||||
|
formats: string[] = ['markdown']
|
||||||
|
): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(`${apiUrl}/storage/recordings/markdown`, {
|
const response = await axios.post(
|
||||||
url,
|
`${apiUrl}/storage/recordings/scrape`,
|
||||||
name,
|
{
|
||||||
}, {
|
url,
|
||||||
headers: { 'Content-Type': 'application/json' },
|
name,
|
||||||
withCredentials: true
|
formats,
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
withCredentials: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (response.status === 201) {
|
if (response.status === 201) {
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user