I developed a program to interact between Telegram and other 3rd party Software. It's written in Python and I used the Telethon library.
Everything works fine, but since it uses my personal configuration including API ID, API hash, phone number and username, I would like to know how to handle all of this if I wanted to distribute the software to other people.
Of course they can't use my data, so should they login into Telegram development page and get all the info? Or, is there a more user-friendly way to do it?
Since the API ID and the API Hash in Telegram are supposed to be distributed with your client all you need to do is prompt the user for their Phone Number.
You could do this using a GUI Library (like PySide2 using QInputDialog) or if it is a command line application using input(). Keep in mind that the user will also need a way to enter the code they receive from Telegram and their 2FA Password if set.
Related
I am trying to create a python program that takes input of what homework assignments I have and stores all of that information so that I can send a notification to my phone when assignments are coming up. I want to be able to give input from my phone throughout the day and cant seem to find a way to interact with my script on my computer from my phone. Any ideas? Ps: if you know a way that I can send notifications to my phone that would also be cool.
It looks like you should create a classic client/server architecture. This is quite a big task. Your program running on your Windows computer acts as a server waiting for client (mobile application) requests. I propose to create a widely used REST API service using e.g. the Flask framework (server side) and use the Retrofit framework for the Android application.
Remember that when using the application on the Internet, you will have to ensure the availability of the server.
To send notifications from the server to the app, use Firebase Cloud Messaging
So I am making a python program which sends a communication to customers reminding them about the due date for their insurance premium payment.
I thought of making a small tkinter user interface which takes in date of birth and policy number of the customer for authentication, and then just show a button "Pay" to somewhat represent the payment process. This user interface would be connected to my main python program which runs the mysql database.
Since I am sending an email to the customer reminding him of the payment, it would be obvious to include the payment link also.
So is there a way to create a link and send it in an email, which has the payment interface, and later get back inputted information from that link.
In simple terms, the main program and the backend will remain with me, while I send a copy of the payment interface to the customer via email. Then there must be some way I can get any inputted information back to me.
All help big and small is appreciated. Thanks!
I would personally, make a link for the download and send it to the person to make the payment. How to make an exe? Use pyinstaller, and if the code is big and have dependencies then I would making a setup with Inno setup. and upload it to an online storage and send that link of download to the client.
Then with pyinstaller make an exe with a directory.
pyinstaller -D -w myscript.py
This is to be said in the command prompt.
And then after making a setup, get that setup into a online storage like Dropbox or Google Drive or Mega.
Anyway keep in mind that to send mails with links maight go into the spam folder. Also this app will give them a warning for virus as the app requires a digital signature that you have to purchase, to make the app not detected by Windows Defender or so.
Apart from all these, you will need a remote database in order to send the data to a database to be accessed by you.
Anyway hope you found this helpful.
Cheers
TLDR: I have a slack app for managing private channels in its development workspace and tokens for it that inherit my user privileges. How can someone else in the same workspace obtain tokens for this app that inherit their user privileges instead?
Ok, so the background of this is: i need to manage the membership of a bunch of private channels based on some more or less complicated ldap-related conditions. For this, i wanted to write a simple Python program that got the membership of the channels in question, did its ldap magic to figure out who should be where, and then make it so.
I have implemented this and all works fine so far. The issue now is that i (that is my slack user) cannot be in all of these channels for privacy reasons. The API and Bot tokens i have obtained inherit all of my own user privileges. That means i can neither see nor administrate the channels that i'm not a part of.
Based on what i've read in the documentation of the Slack API, there's a way to have another user go through the OAuth process for the app that i created to get the tokens, get their own tokens, and use them with the Python program that i wrote. That would be fine, but i can't figure out how to do this.
Noone else has access to the app directly. The documentation makes it seem like i need to give people a specially formatted link (the "Add to Slack Button") that they can click on to get taken through the process. But that seems to require a "redirect URL". I'm not sure what this is and the documentation isn't very clear on it, but it seems they are assuming that the app is running on a server somewhere and will need to answer requests from Slack or something. That's not the case. It's a fairly simple Python script, not some always-up cloud app that will be responding to Slack Events.
So it feels like i'm missing something. Either i have some fundamental misconception about how this is supposed to work, or there is a simple way for someone else to get a token like that and i'm not seeing it.
Yes. If you want other users to authenticate your app (e.g. generate tokens so your app can perform tasks on the users behalf) you need to create an installation routine using Ouath 2.0. That installation routine is a small web app that has the "Add to Slack" button, a HTML interface and is able to run through the Oauth 2.0 process. That web app needs to run on a public web server.
For development purpose that web server can also run on your local dev machine with a VPN tunnel to the public Internet. Slack recommends using the VPN service ngrok for that purpose.
I am writing web service in python to work with WhatsApp. I am using pywhatsapp library for that. But can anyone tell me how to get my WhatsApp password? It is needed for Login using pywhatsapp.
Hours of searching in Google didn't give any result.
You can use the yowsup cli to register a new WhatsApp user. During this process you will get a new password. Just download the cli and follow the instructions under yowsup cli.
You should also be able to reregister your own mobile number if it has already been used with WhatsApp. (e.g. on your phone)
I am trying to automate a few things for my twitter account,
Is it possible to follow the followers of a selected user via a python script ?
Yes, it is possible, you even can rely on third party applications that can do this for you: http://pypi.python.org/pypi/twitter/1.6.1
The other solution is to rely on their API and make the correct HTTP calls there by yourself.