Get Notified when a file changes on dropbox - dropbox

Does dropbox have a way of notifying when a file changes i.e arrival of new uploads or a file has changed.

Though you will still have to poll, there's a relatively new API endpoint called /delta that will let you poll much more efficiently than the /metadata endpoint.
It's better than using the RSS feed.

As Kannan points out, there's a new API endpoint called /delta that's better than polling or RSS.
This can also be used in conjunction with the /longpoll_delta API endpoint :
A long-poll endpoint to wait for changes on an account. In conjunction
with /delta, this call gives you a low-latency way to monitor an account
for file changes.

This delta API can be called to get sync
http://forums.dropbox.com/topic.php?id=53533

Dropbox now officially offers Webhooks https://www.dropbox.com/developers/blog/90/announcing-dropbox-webhooks

Dropbox recently announced WebHooks!
If you're interested in helping us out, just click through to fill out
your information, and we'll be in touch:
Happy Dropboxing!

Though Dropbox's delta API is used to get a list of all the modified file details, a webhook is what one needs to get notified about a change (change being modification, addition or deletion of a file)
Go to: Dropbox Developer App Console
Click on your App that contains the files whose changes you want to be notified.
Scroll down to "WEBHOOK"
Paste the link that will handle the notifications via POST method.
Click ENABLE.
Moment you click enable, the dropbox sends a request to the link you entered to see if it responds to the GET request or not. You need to make sure that the link does respond to it. If working with Python and Flask frame work, following two lines of code is sufficient:
#app.route('/webhook', methods=['GET'])
def verify():
'''Respond to the webhook verification (GET request) by echoing back the challenge parameter.'''
return request.args.get('challenge')
Now you will be notified via POST to the above link every time a change is made to dropbox.
Deal with the notifications the way you want to. :)

If you have a computer with Dropbox installed that is always on, you can set a script to run whenever Dropbox pops up a change notification. That script could then grab the change log using RSS (or the /delta API) and if the file/directory you're interested has changed, send a notification.
On Mac, Dropbox can send notifications to Growl and you can tell Growl to run your script. On Windows you will need to monitor for Notifications in the system tray using something like gTraySpy. Growl for Windows can do this if you install the Windows Balloons plugin.
As long as you can get a script to run when a change has occurred, it's just a matter of parsing the change log and performing an action when certain item(s) have changed.

Dropbox has a new long polling endpoint for deltas:
https://www.dropbox.com/developers/blog/63/low-latency-notification-of-dropbox-file-changes

Dropbox SYNC API is the way to go
DBPath *path = [DBPath root];
[fileSystem addObserver:self forPathAndChildren:path block:^() {
NSLog(#"something changed in your dropbox folder!");
}];

Related

Cocoa app, how to show the badge label when app isn't running?

I've noticed the Spark mail app manages to show a badge count even when the app isn't running. The app is a mac app store app so it must not be using any private APIs. Is there a way to do this? Currently I'm only able to do the following while the app is running:
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:[NSString stringWithFormat: #"%ld", 10]];
You need to make a Dock tile plugin. See the documentation for NSDockTilePlugIn for information on how to do this:
https://developer.apple.com/documentation/appkit/nsdocktileplugin
EDIT: Okay, if you want to do what Spark is doing, here it is:
Spark is using Apple Push Notifications to inform you of new e-mails that come in. For e-mail accounts other than Gmail or Outlook, this generally means they store your username and password on their server, which seems "OMG!" levels of creepy to me, but YMMV. When their server notices that you have a new e-mail, they forward the notification to you.
A description of what Spark is doing can be found here: https://blog.readdle.com/how-we-handle-your-account-information-in-spark-1b42f4acef73
If you want to implement push notifications yourself, this video shows generally how to do it, and this sample code may be helpful as well.

Detect a user's current song in Spotify api

I was wondering if it was possible to detect what song a user is listening to from his/her current active device via the spotify web api.
Thanks.
I know this is an old question, but there is a new beta API endpoint available that supplies this information. It does have some bugs that I've noticed though.
Stations only: If you change stations, you have to restart Spotify to get the API endpoint to update and continue updating.
According to bug reports, it lags behind 20 to 30 minutes at random. I haven't had that problem, so it may be fixed.
GET https://api.spotify.com/v1/me/player/currently-playing
Docs: https://developer.spotify.com/web-api/get-the-users-currently-playing-track/
This is not possible using the web API. If you're writing a Mac app, you can use the Spotify Desktop Client's AppleScript API to access the current track. If the user is scribbling to Last.fm, you can use Last.fm's APIs. Otherwise, this data is not accessible.

Play framework, limit an action to be done once

I have a button follow on my website, you can toggle it on or off as much as you want.
Each time it sends a notification mail to the followed people. I don't want him to be spammed.
So I want Play Framework not to send this mail twice (twice in a day, for example)
Is there any built-in mechanism or any library of play framework to do it?
Thanks !
EDIT :
Preferably an external service, like Mailjet or mailchimp.
Just save notification to DB instead of sending it immediately - so user can decide how often he want's to get it.
Next use Akka scheduler for sending many notifications in single emails from time to time.

Dropbox API: Get Notified On File Events Without Polling

I found this post on getting Notified when a file changes on dropbox. The problem is that the "/delta" API endpoint requires polling. I want instead to subscribe to events about file changes.
Ideally, I could subscribe to both "new file" and "file updated" events for a specific folder. I could then give dropbox a URL pointing to my own app that would be called when those events occurred. This is similar to how Twilio works. You can provide a URL to be POSTed to whenever your phone number receives a text message, and then your app can respond to POSTs to that URL however it wants. This seems like a much more elegant solution than polling -- is there any way to do it with the dropbox API?
UPDATE 6/5/2014
We actually have webhooks now: https://www.dropbox.com/developers/webhooks
(original reply below)
No, Dropbox doesn't support this.
BTW, the general term for the sort of notification you describe is a "webhook."
http://developers.box.com/webhooks/
it seems like Box API has webhook. You may want to try it.
I received an email today regarding Dropbox WebHooks that is in the beta phase:
If you're interested in helping us out, just click through to fill out
your information, and we'll be in touch:
https://dropboxapi.wufoo.com/forms/dropbox-webhooks-api-beta-feedback-contact-info
Happy Dropboxing!
Dropbox now offers webhooks, although not with a event_type filter
https://www.dropbox.com/developers/blog/90/announcing-dropbox-webhooks

Is it possible to mark the message thread with 'unseen=0'?

I work on Google Chrome extension for facebook.
I have a button and if you click on it, a popup with latest active threads appears. I want to say to facebook server that no threads are 'unseen' afterwards. So that the messages jewel on Facebook main page will show no notifications.
Can I do this with Graph API? POST calls to graph.facebook.com/thread_id with unseen=0 don't work.
Alternatives?
You do not have write access to the inbox. Only read access read_mailbox. Sorry, but that's the only permission that Facebook currently has available. See: https://developers.facebook.com/docs/reference/api/permissions/
However, you can keep track of the inbox items on a remote server's data store and have your plugin query that to know what's been "seen". So at least from your plugin's perspective, things are showing up correctly.