Jump to content

xtin

Member
  • Posts

    46
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by xtin

  1. Hi boulevard,

     

    This workflow is using a command line version of a telegram client - it's basically as if Alfred was remote controlling your normal Telegram client. The data is stored locally, you only interact remotely with Telegram servers. 

     

    Most Alfred integrations either control a program on your PC or call some remote server for the work to happen. As for security, the code is open, but nothing about them makes them particularly safe - afaik no-one reviews them in this regard. But that's a problem of PCs in general, and not Alfred in particular ;)

  2.  

    On 7/25/2016 at 4:23 PM, freakysheep said:

    Has anybody the newest version of this workflow? Download links seem to be dead. Perhaps xtin could put it on github?

     

    For some reason droplr decided that the links work again. So the download links magically are good again :) - Feel free to work based on it, it's quite arcane though and skype decided to  ban the way I accessed it a long time ago.

  3. Hey! After 6 Years of Mac abstinence I'm back to OSX and Alfred was a main reason to switch back :D

     

    But what Skype was then, Telegram is today and I saw that there is no Workflow for Telegram 😪 - unbearable.

     

    So here it is. It's a first rough prototype but it does exactly what it should.

    It's a quite decent prototype, still lacking the really cool features, but quite stable - yay.

     

    UPDATE: I've switched to delivering a self-compiled version of telegram-cli from a more up-to-date repo, 'treset' should unlock it - but please let me know if it doesn't run. You might have to run "brew install telegram" nonetheless to install all the linked libraries it requires - I can't really test without a second Mac around. If you don't like binary blobs, feel free to build "telegram-cli" yourself from the kenorb-contrib repo and replace it in the workflow's directory.

     

    t - write to a user or group, see history 

    th - show history with user and send message

    tc - Talk to Groups

    tr - Quick reply to last user

    ta - Activate Telegram with user selected

    treset - Delete cache files (should have no effect), remove com.apple.quarantine flag from telegram-cli and start telegram-cli in terminal window, so you can 

     

    it requires that you install telegram-cli, which - if you have brew installed - is a mere "brew install telegram" away.

     

    Before you can use it, you have to run 'treset' once, to remove the quarantine-flag from telegram-cli and log into telegram! 

     

    Telegram session information is stored in /.telegram-cli and not in the workflow directory.

     

    = Releases =

    0.0.1: Initial Release with commands: t, th

    0.0.2: Added tr, tc

    0.0.4: Major update: own telegram-cli from different repo (https://github.com/kenorb-contrib/tg, vysheng's seems abandoned, and brew installs the one from vysheng), merged th, tc and t, added ta to activate telegram with a certain user selected

     

    = Get It =

    https://github.com/xtin/TeleFred/blob/master/TeleFred.alfredworkflow

     

    = Wish List =

    - tg - Talk to Groups - currently limited because telegram-cli segfaults on the dialog_list command (known bug: https://github.com/vysheng/tg/issues/1580 ) - so we don't know what groups there are.

    - tl - show 5 last conversations (likely victim to same bug)

    - tr - Quick reply to last user

    - tc - Call user

    - tclip - Send clipboard to user

    - tss - Send last screenshot to user

    - Show media in the history

    - Load user pics and show them in the preview

     

    = If you want to help, that's very welcome! You can also talk to me on Telegram: t.me/raf_ael =

    Screenshot 2019-12-21 at 02.33.48.png

  4. Here's a quick workflow for wunderlist 2, it uses its undocumented api

     

    To use it you need to edit the file wunderfred.py in the workflow, there is a line that you need to edit your login credentials to:

           w = Wunderlist("email","password") #<<< Add login credentials here!

    It has 3 commands.

     

    wlup - updates the cached list (takes a while)

    wlt - lists the tasks filtered by whatever you type after the keyword. If you select a task and hit enter, it will be marked completed.

    wla - adds a new task to the list you select by searching. whatever is after the : will be written to the task

     

    WARNING: I do not have the time and will therefore not support this workflow, I just put it out there, for someone to pick it up and hone it into a more polished workflow. It works fine for me and has all that's necessary, but there are several things that could be improved. (e.g. login credentials, convenient way to set importance and other things required.). Also it might break at any time if wunderlist changes their api, as it is not documented, there is also no guarantee for it to stay that way. If you feel on improving on it, let me know, I will gladly link this thread to your version. 

     

    Download: http://d.pr/f/J7v0

     

    Credits: Based on the reverse engineering and code done by bsmt: http://bsmt.me/blog/2013/03/02/reverse-engineering-the-wunderlist-api/

  5.  

    Traceback (most recent call last):
      File "vinc.py", line 3, in <module>
        print s.sendMessage("skype update")
      File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 144, in sendMessage
        _getAvatars()
      File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 215, in _getAvatars
        bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
      File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/Image.py", line 1290, in resize
        self.load()
      File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/ImageFile.py", line 201, in load
        raise IOError("image file is truncated (%d bytes not processed)" % len()
    IOError: image file is truncated (7 bytes not processed)
    

     

     

    However, I have now 100+ images in avatars directory, so it looks like one of the images is corrupted. 

    Any idea how to fix that?

     

    Thanks

     

    Thanks for digging into this and sorry for my sluggish reply. 

     

    Interesting problem... if you delete the avatars folder in the extension directory and try again, does the same number of images show up again? It might be that something went wrong during extraction. The most general tip is to wrap

     
        with contextlib.closing(sqlite3.connect(path).cursor()) as db:
            for av in db.execute("SELECT skypename,avatar_image FROM Contacts WHERE type=1 AND is_permanent=1 UNION"\
                                 " SELECT skypename,avatar_image from Accounts"):
                if av[1] is not None:
                    with open("avatars/"+av[0]+".jpeg","wr") as f:
                        f.write(str(av[1])[1:]) #For some reason, the first byte is 0, then the jpg starts.
                    bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
                    bg.save("avatars/"+av[0]+".jpeg")
                    for v in vers:
                        bg = Image.open("avatars/"+av[0]+".jpeg")
                        #bg.thumbnail((96,96),Image.ANTIALIAS)
                        fg = Image.open("images/status_"+v+".png")
                        bg.paste(fg, (0, 0), fg)
                        bg.save("avatars/"+av[0]+"_"+v+".jpeg")
    
    

    with try, except:

     

     

     

    with contextlib.closing(sqlite3.connect(path).cursor()) as db:
            for av in db.execute("SELECT skypename,avatar_image FROM Contacts WHERE type=1 AND is_permanent=1 UNION"\
                                 " SELECT skypename,avatar_image from Accounts"):
                try:
                    if av[1] is not None:
                        with open("avatars/"+av[0]+".jpeg","wr") as f:
                            f.write(str(av[1])[1:]) #For some reason, the first byte is 0, then the jpg starts.
                        bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
                        bg.save("avatars/"+av[0]+".jpeg")
                        for v in vers:
                            bg = Image.open("avatars/"+av[0]+".jpeg")
                            #bg.thumbnail((96,96),Image.ANTIALIAS)
                            fg = Image.open("images/status_"+v+".png")
                            bg.paste(fg, (0, 0), fg)
                            bg.save("avatars/"+av[0]+"_"+v+".jpeg")
                except IOError:
                    pass
     

     

  6. I tried to debug a bit more and I get:

    ...

    Not sure yet how to fix this since I don't know python, I'll google it. But if someone knows the issue, that would be great :-)

     

    That's great thank you, exactly what i needed! I will publish a version today that will remedy that problem :)

     

    Is it possible to use my custom aliases? For example, I'd love to type "s Dad" instead of "s [my Dad's name]"

    Also, thanks for the great workflow. The "Reply to last message" is a huge time saver for me.

    What you you can do is rename your dad's visible name in skype so it contains "Dad", you should then be able to "s dad", where he should be the first hit. (If not, add "dad" twice, the entries are sorted by the number of characters that are match your query, e.g. if you do "s dad" and the skypename of your dad is daddaddad, it will return 9 as 9 chars have been matched ;) ) After you changed the name, run "s update" to load the namechange into the cache.

     

    (Note: What is displayed as name is what the user has set as his full name, only if no fullname is set, the given name (the one you set) is displayed, for searching though, the account name, fullname and given name are used)

  7. Hi,

     

    With latest update (BTW there is no more icon for the extension) and after doing a "s update", I only have one avatar in the avatar directory. (with prior version, I had all avatars)

    I don't really know what I can do to debug the issue, any suggestion?

     

    Note: the only avatar that gets loaded is from a contact that has been removed from my contact list since a long time, not sure why it is still present in Skype DB.

     

    PS: your workflow is awesome!

     

    Hi, for the avatar in the directory, is there online one image or are there variants _online.jpg, _offline.jpg ... ?

  8. Yes, the convo is always loaded afterwards and cached. 

     

    Did you do "s update"? If yes, and you still don't get the right icons, can you go to Alfred, select the Skype workflow, open a part of it (doesn't matter) and hit "open workflow" directory, then there is a folder "avatars" does it contain images? and if so, the avatars of your friends or just the skype icon multiplied?

     

    Thank you for your help, that part I couldn't test on another mac, so any feedback is important! 

     

    The colored corner match the current status of a user, white offline, green online, yellow busy, red DND

  9. edit: After installing the current version everything works like a charm. Thanks for that! :)

     

    edit2: One small bug i noticed. Sometimes the message gets cropped. See the screenshot:

     

    https://dl.dropbox.com/u/7616878/croppedmessage-screen.png

     

    Best regards

    m0mo

     

    puh, good to know it works well on 10.6 then :)

     

    The cropped message is a known problem, i try to mediate it by caching as much as possible, you can avoid it by taking a breath and then hitting enter ;)

  10. Download this workflow, done: http://d.pr/f/Qt7K (using this technique: http://www.alfredforum.com/topic/1379-how-to-use-global-hot-keys-to-pick-applications/)

     

    Download this workflow: http://d.pr/f/R0ee

     

    Replace the shortcut in the Run NSApplescript part of the workflow with your global divvy shortcut, done. (i have it on option+shift+w)

     

    (Notes:

    - I would have liked to simply use tell Divvy to activate, but Divvy didn't like it.

    - In this occasion I found the standard icon quite fitting, so I didn't bother adding one :D)

  11. Quick little bug - when trying to send the word "Alfred" in a message, it only sends "Alf"

    Unfortunately this is an alfred limitation, see here: http://www.alfredforum.com/topic/1416-incomplete-query/ and my feature request here: http://www.alfredforum.com/topic/1470-send-the-content-of-the-input-line-from-scriptfilter-to-the-next-step-as-input/ - if you want to support it, maybe +1 it ;) - I tried to minimize it as much as possible by caching the query from skype the first time it is made and then simply return it from file. You can "remedy" it, by waiting half a second before hitting enter.

     

    Awesome! This is really great!

     

    Here are some small little things I realized:

    - The conversation does not seem to include my own picture. Only the one from the person I am talking too. I get the Skype icon.

    - I saw a number of empty messages and I think they show up when the last part of a conversation was a phone call. Is that possible? I would change that either to informations about the call (duration with call icon) or just remove these rows.

    - For `sr`, I think it would be better if you show the conversation right away without waiting for the user's confirmation. Currently, the user has to type 'sr', press enter (which complete the name), then the conversation show up and s/he can type. Maybe you can show the conversation right away without the enter step. But I am not sure about this. Would have to try.

     

    Great work! I will use this tomorrow all day and let you know when I come across something else.

     

    Glad you like it, i'm really eager for every bug you can find!

     

    - This is known and not done so far from my laziness. I added it as a request (now i feel it's important, so i will do it :P)

    - Indeed, the empty messages are calls. Essentially Skype stores that information as an XML and I simply filter out any tags. I'll add a check to remove such empty messages, or maybe I can exclude them in the db query already.

    - Another token of my laziness, this way I could just reuse the code for snew by limiting the number of returned people to one, but you're right, it should be done differently, it started to annoy me too. (btw: you can also use tab for autocompletion, more intuitive for me as a coder) 

×
×
  • Create New...