Skip to content
Snippets Groups Projects

Pushover

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Daniel Schön
    Edited
    sendToPushover.m 853 B
    % Register at https://pushover.net/
    
    function sendToPushover(title, message)
        API_TOKEN = 'Blabla';
        USER_TOKEN = 'Blabla';
        %message = 'Hallo';
        %title = 'Title';
        
        if length(message) > 512
            disp('(sendToPushover): Max. length for messages is 512 characters.');
        end
    
        post_params = {'token', API_TOKEN,...    % API token
                       'user', USER_TOKEN,...    % user's ID token
                       'message', message,...    % message to push
                       'title', title};          % message title in notification bar
        
        try
            urlread('https://api.pushover.net/1/messages.json', 'Post', post_params);
            %webwrite('https://api.pushover.net/1/messages.json', post_params);
        catch ME
            disp(ME.message);
            disp(ME.stack);
        end
        
        disp('Send message to Pushover...');
    end
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment