AutoTools Get unread Reddit posts, create notifications and read them on Chrome Custom Tabs 2016-09-23

Learn how you can read your favorite Reddits on a Chrome Custom Tab via notifications

  1. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    joaomgcd submitted a new AutoApps project:

    Get unread Reddit posts, create notifications and read them on Chrome Custom Tabs - Learn how you can read your favorite Reddits on a Chrome Custom Tab via notifications

    Read more about this project...
     
  2. CSWinnall

    CSWinnall New Member

    Joined:
    May 31, 2015
    Messages:
    7
    Likes Received:
    0
    Many thanks. This is great I use it every day I have also added an autotools dialogue to the start of get reddit posts so I can choose which subreddit I want to check. Tasker, Android or SamsungS7
     
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Awesome! :)
     
  4. maurizio53

    maurizio53 New Member

    Joined:
    Jun 14, 2016
    Messages:
    21
    Likes Received:
    0
    Any chance to share your profile?
     
  5. CSWinnall

    CSWinnall New Member

    Joined:
    May 31, 2015
    Messages:
    7
    Likes Received:
    0
    Here it is
    I've also added a drop down the notification bar when the done button is clicked so i can carry on checking the other posts.

    Code (Text):

    Get New Reddit Posts (15)
    A1: AutoTools Dialog [ Configuration:Dialog Type: 3 Choices
    Title: Get New Reddit Posts
    Choice One: tasker
    Choice Two: android
    Choice Three: trance
    Text Size: 20
    Dim Background: true
    Top Margin: 16
    Bottom Margin: 16
    Bottom Buttons Top Margin: 16
    Bottom Buttons Bottom Margin: 16
    Cancelable: true
    Turn Screen On: true Timeout (Seconds):60 ]
        A2: Variable Set [ Name:%bigicon To:/storage/emulated/0/Join/Files/redditicon.png Recurse Variables:Off Do Maths:Off Append:Off ]
        A3: Variable Set [ Name:%smallicon To:/storage/emulated/0/Join/Files/redditstatusbar.png Recurse Variables:Off Do Maths:Off Append:Off ]
        A4: If [ %atcommand Set ]
        A5: AutoTools Json Read [ Configuration:Input Format: Json
    Json: https://www.reddit.com/r/%atcommand/.json
    Fields: data.children.data.created_utc(),data.children.data.title(),data.children.data.permalink(),data.children.data.thumbnail()
    Query: permalink
    Variable Name: postid(),title(),link(),icon()
    Separator: , Timeout (Seconds):1800 ]
        A6: Variable Set [ Name:%joiner To:-+-+ Recurse Variables:Off Do Maths:Off Append:Off ]
        A7: Variable Join [ Name:%title Joiner:%joiner Delete Parts:On ]
        A8: Variable Join [ Name:%postid Joiner:%joiner Delete Parts:On ]
        A9: Variable Join [ Name:%link Joiner:%joiner Delete Parts:On ]
        A10: AutoTools Text [ Configuration:Text: %icon()
    Variable Name: icon()
    Monetize: false
    Pad Right: false
    Trim: false
    Replacements: %icon\d+=:=self
    Regex: true
    Joiner Variable: atjoinedtext
    Exact: false
    Regex: false
    Case Insensitive: false
    Contains All: false
    Url Encode: false
    Dip to Pixels: false
    Pixels To Dip: false
    RGB To HSV: false
    RGB To Phillips Hue Color: false
    Separator: , Timeout (Seconds):60 ]
        A11: Variable Join [ Name:%icon Joiner:%joiner Delete Parts:On ]
        A12: AutoTools Arrays [ Configuration:Input Arrays: %postid|||%title|||%link|||%icon
    Vertical Mode: false
    Separator: |||
    Item Separator: %joiner
    Input Is File: false
    Names: postid,title,link,icon
    Output Variables Separator: ,
    Sort Arrays: false
    Invert: false
    Randomize: false
    Merge Arrays: false
    Merged Array Name: atmergedarray
    Unique: false
    Exact: false
    Regex: false
    Case Insensitive: false
    Contains All: false
    Name: reddit%subreddit
    Clear For Name: false
    Clear For All: false Timeout (Seconds):60 ]
        <Stop>
        A13: Return [ Value:0 Stop:On ] If [ %postid(#) ~ 0 ]
        A14: For [ Variable:%index Items:1:%postid(#) ]
        A15: Variable Set [ Name:%icon To:%icon(%index) Recurse Variables:Off Do Maths:Off Append:Off ]
        A16: Variable Set [ Name:%icon To:%bigicon Recurse Variables:Off Do Maths:Off Append:Off ] If [ %icon ~ self ]
        A17: AutoNotification [ Configuration:Title: New %atcommand Post on Reddit
    Text: %title(%index)
    Action on Touch: checkredditpost=:=%postid(%index)=:=%link(%index)
    Icon: %icon
    Status Bar Icon Manual: %smallicon
    Status Bar Text Size: 16
    Id: %postid(%index) Timeout (Seconds):20 ]
        A18: End For
        A19: Return [ Value:%postid(#) Stop:On ]
        A20: Else
        <Stop>
        A21: Return [ Value:0 Stop:On ] If [ %postid(#) ~ 0 ]
    To Open The Reddit Post in a Chrom Custom Tab

    Code (Text):


    Profile: Check Reddit Post (18)
        Event: AutoApps Command [ Configuration:Command Filter: checkredditpost=:=
    Case Insensitive: false
    Exact: false
    Regex: false
    Variable Names: postid,link
    Variable Array: false ]
    Enter: Anon (14)
        A1: Flash [ Text:Opening reddit Post... Long:Off ]
        A2: AutoTools Chrome Custom Tabs [ Configuration:Url: https://www.reddit.com/%link
    Toolbar Color: #FF64B5F6
    Action Button Command: clearnotification=:=%postid
    Action Button Image: android.resource://net.dinglisch.android.taskerm/hl_navigation_accept
    Enable Url Bar Hiding: true
    Continue Task: true Timeout (Seconds):300 ] [\CODE]

    And To Clear the notification

    [CODE]

    Profile: Clear Notification (17)
        Event: AutoApps Command [ Configuration:Command Filter: clearnotification=:=
    Case Insensitive: false
    Exact: false
    Regex: false
    Variable Names: notificationid
    Variable Array: false ]
    Enter: Anon (16)
        A1: AutoNotification Cancel [ Configuration:Id: %notificationid
    Cancel All: false Timeout (Seconds):0 ]
        A2: AutoInput Global Action [ Configuration:Action: Back Timeout (Seconds):20 ]
        A3: AutoNotification Query [ Configuration:Persistency Type: Non-Persistent Only
    Title: New*
    Use Regex: true
    Has Reply Action: false
    Get All Fields : false Timeout (Seconds):20 ]
        A4: AutoInput Global Action [ Configuration:Action: Open Notifications Timeout (Seconds):20 ] If [ %antitle() ~R New* ]
     
     
    Last edited: Mar 21, 2017
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Did you import the attached profile?
     

Share This Page