简体   繁体   中英

how to automatically download any image from a url to your phone with vanilla javascript or node js?

I know this is a huge thing, I have no idea what to do, just need some directions. simply i want to download hot/top post images (1-5) to my phone from reddit-api automatically every 24 hours. how can i approach this?

ps: i can work with MERN stack

I can think of 2 approaches. But I'm not sure if this is the best solution.

First Approach

Write a mobile application by using React-Native, Flutter, etc. Run the application in the background and use a cronjob to get the image every 24 hours.

Second Approach

If you don't want to write a mobile application:

To get the image from Reddit. If Reddit-API didn't work, you have to mess with web scraping and Javascript have plenty of libraries to do this:

For doing this task every 24 hours you can use

and when you get the image, rather than download the image to the phone you can save it on your computer or the cloud:

  • AWS s3
  • Azure blob
  • Google cloud storage

or send it through chat like:

  • Facebook (Facebook API)
  • Twitter (Twitter API)
  • Telegram (Telegram API)
  • LINE (LINE API)

but if you want to download the image to your phone and the image was saved on the local computer, you have to connect the phone with the computer and use ADB. It's a command-line tool that lets you communicate with an Android device (If your phone is an Android) that is connected over USB and it has a command to pull the image to the phone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM