1

I'm starting work on a new project and I need to know the feasibility of the end-result. I need a lot of things to happen automatically.

  1. Detect if a new file has been added to a folder
  2. Login to a website (like Strava or TrainingPeaks)
  3. Upload the file to my account on the website

Any advice on this front is appreciated. I really just need to know if this is possible and what I would need to make it happen.

Will Luce
  • 111

1 Answers1

2

To detect when a new file is created in or under a directory, use the inotify facility. See Can a bash script be hooked to a file? and How to run a command when a directory's contents are updated? for examples.

Logging in to a website is very dependent on how the website manages authentication. Uploading the file is generally simple once you're authenticated but there's no standard for what URL and parameters to use. So you need to figure that out site per site. See Automating tasks on a website on a headless server, Is there a way to use curl interactively? Or is there an interactive curl/wget shell?, Automating web requests using curl? for some examples.