Forum Archive

Peer to Peer Chat

NoBetterName

None of the online server and client programs for peer to peer chat rooms work on iOS. I'm not quite sure why. I'm not even sure that socket is the right path for me. Is there any way to use my Pythonista app as a client and directly send messages? I'm thinking of a custom SMS or even SMTP sender/receiver. Can iOS and Pythonista do something like this?

ccc

SMTP mail send is built into Python https://docs.python.org/3/library/smtplib.html#smtp-example

On SMS, put into Safari site:forum.omz-software.com SMS

Also check out the Workflow app which has actions:
* Call
* Facetime
* Post to Slack
* Send message
* Run Editorial Workflow
* Run Script (Pythonista)
* Open X-Callback URL

From Pythonista, you can webbrowser.open('workflow://run-workflow?name=name&input=input') to kick off a workflow.

https://techcrunch.com/2017/03/22/apple-has-acquired-workflow-a-powerful-automation-tool-for-ipad-and-iphone/

NoBetterName

I don't really understand socket or HTTPlib or anything like that, but I'm looking for something that I can send and receive all inside Pythonista. I hope this makes sense. I like Workflow, but it isn't what I was looking for. SMTP and SMS are great, but you can only send them through Pythonista, not receive them. I guess my very broad question could be narrowed down to this:

Is there any Apple-based or Pythonista-based system that I could take advantage of to send and receive messages through Pythonista?

dgelessus

@NoBetterName In general the SMTP protocol is only used for sending mail. To receive mail (or rather to read and manage mails on your account) you'd use the IMAP protocol. Python also has an imaplib module in the standard library for that.

JonB

What specifically are you trying to do? create your own "messenger" type program? Or just some other generic client/server application?

ccc

@NoBetterName https://github.com/fluentpython/example-code/tree/master/18-asyncio/charfinder has a script called tcp_charfinder.pythat might be worth checking out. It uses asyncio to avoid blocking calls so it is Python 3 only

NoBetterName

I'm trying to make a peer to peer messaging program, as the title suggests. I need a program that directly sends messages to other devices. Thanks for your help guys.

ccc

Were you able to get tcp_charfinder to work?

ccc

@NoBetterName I would be interested to work with you on the chat client if you open a repo with a reasonable license. If you put the parts that you know how to do in there, we can build the rest together.

mikael

@NoBetterName, if you want to create a p2p chat, and the emails, sms etc. were just ideas on how to move the chat messages, I suggest you check Pubnub and/or getstream instead. Or Amazon Web Services, Azure or Google messaging and notification services. All have example chat implementations and free options to get started with.

julliemak

Vehicle owners to renters, to discuss different things related to the vehicle rental. nether portal