scrape-it icon indicating copy to clipboard operation
scrape-it copied to clipboard

Async convert functions

Open jdalrymple opened this issue 6 years ago • 5 comments

Would it be possible to support async convert functions?

jdalrymple avatar Nov 30 '18 19:11 jdalrymple

That'd be cool! ✨

IonicaBizau avatar Dec 31 '18 12:12 IonicaBizau

I spent some time to try and implement it, but it was turning out to be more difficult then i thought lol

jdalrymple avatar Jan 03 '19 14:01 jdalrymple

Hi, thanks for this great scraper !

Do you have any news on this ? I tried on my own firstly with your assured library then with other workarounds, but with no success

You can find part of my tries at https://github.com/jon-ht/scrape-it/tree/async-convert-function However, it seems to totally break Promise's based interface.

This is what I get when I run node example/index.js

Callback interface

{ articles: 
   [ Promise { [Object] },
     Promise { [Object] },
     Promise { [Object] } ],
  pages: 
   [ Promise { [Object] },
     Promise { [Object] },
     Promise { [Object] },
     Promise { [Object] },
     Promise { [Object] },
     Promise { [Object] },
     Promise { [Object] } ],
  title: 'Ionică Bizău',
  desc: 'Programmer,  Pianist,  Jesus follower',
  avatar: '/@/bloggify/public/images/logo.png' }

Promise interface

Status Code: 200
{ title: 'Ionică Bizău',
  desc: 'Programmer,  Pianist,  Jesus follower',
  avatar: '/@/bloggify/public/images/logo.png' }

jon-ht avatar Jun 24 '19 10:06 jon-ht

Hello @IonicaBizau, an update is planned to make it possible to use async functions in the convert?

It would be a great step forward and I think you will spend less time developing this than the community for a better result.

Aperrix avatar Oct 10 '20 15:10 Aperrix

I am very busy with other projects right now, but contributions to make this better are always appreciated.

I guess if we implement a series promise option, that would not be difficult since we can use async-await, so syntax won't change much.

IonicaBizau avatar Oct 10 '20 16:10 IonicaBizau

I am going to close this for now, but thank you very much for the idea. We will see if anyone else needs such an interface. Cheers!

IonicaBizau avatar Oct 20 '23 12:10 IonicaBizau