Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blower.io Alternative. #44

Open
DevMoore94 opened this issue Nov 7, 2014 · 48 comments
Open

Blower.io Alternative. #44

DevMoore94 opened this issue Nov 7, 2014 · 48 comments

Comments

@DevMoore94
Copy link
Owner

We're gonna need to come up with an alternative to blower.io because 50 messages a month is defiantly not enough.

@mkowoods
Copy link
Contributor

mkowoods commented Nov 9, 2014

We can start looking into some alternatives:

https://www.twilio.com/sms/pricing

http://blog.mashape.com/list-of-50-sms-apis/

@DevMoore94
Copy link
Owner Author

That list will be great. If we can locate the best free one there that'd be awesome. I'm not looking to drop any money into this project as of now. Considering we are really the only ones who work with it/use it.

@mkowoods
Copy link
Contributor

mkowoods commented Nov 9, 2014

Totally agree i would be willing to pick up a twilio account it looked very cheap, but free is better. one thing i've done in the past is create a small algorithm to rotate through the various API's so that you never exceed the limit.

@DevMoore94
Copy link
Owner Author

That sounds like a great idea. We could create a separate python utility file and make use of the algorithm.

@mkowoods
Copy link
Contributor

mkowoods commented Nov 9, 2014

yeah let me know which one's you want to use.

I can put together a quick library to handle the messaging API's. And i can write up an algorithm.

@DevMoore94
Copy link
Owner Author

Whatever ones you feel we can use for free by alternating are fine by me.

@DevMoore94
Copy link
Owner Author

Which API's were you thinking of using?

@mkowoods
Copy link
Contributor

Check this out http://textbelt.com/

@DevMoore94
Copy link
Owner Author

This is defiantly on the right track for something we need. In the future it would be nice to have incoming text messages. But for now ensuring that we have a high number or unlimited out going will be the plan.

@DevMoore94
Copy link
Owner Author

Was messing around with this textbelt and tested it with some carriers and the problem is it doesn't always send a text message sometimes it makes a call and reads the text that way. This was tested with rogers which is a major Canadian service provider. Might be able to use some api's for certain carriers and some for others? Here is the code snippet for sending the post request:

import requests
def send_text(numstring, message):
message = {"number": numstring, "message": message}
r = requests.post("http://textbelt.com/canada", data=message)
return r.status_code, r.text

@syntonym
Copy link
Contributor

I think there is no way to get information on the carrier just based on the number. But as far as i see textbelt only "brute forces" all email2sms gateways of carriers it knows. That should be easy to replicate in python. We could then only restrict to carriers that are known to work (i.e. no call that reads the text).

But that may be a little bit "too much of work". What do you think?

@DevMoore94
Copy link
Owner Author

That does seem to be quite a bit of work. I just keep telling myself that there has to be a free solution somewhere but nothing is ever free is it? haha I am really not sure where to go with this.

@syntonym
Copy link
Contributor

Yeah, free and good are not realy

this is free but it's the method that textbelt uses. In fact textbelt has a list of all the gateways it uses. I don't see a good possibility too examine which are "good" (no call that reads the text).

We could do the following:
Get the list of textbelt and wirte a python method like this:

carrier_worked = False
for carrier_email in carrier_list:
    try:
        send_email("{number}{carrier}".format(number, carrier), msg)
    except CarriesDoesNotWork:
        continue
    carrier_worked = True

if not carrier_worked:
    send_sms_by_blower_io(number, msg)

Then add a button on the website "my sms did not work as intended!" which a user can press the sms were not a sms but a call. If enough user press this button the carrier is deleted from the list. This would get us: A working carrier will use the sms-gateway, a not working will be sent through blower.io.

It should'nt be too much work. (..should'nt...)

@syntonym
Copy link
Contributor

On a different note we could just use textbelt and still implement the button so users can report back to us which carriers do work and which do not and then we could just feedback that back to the textbelt creator. This way he can delete not working carriers. If textbelt does not work at all we can still send through blower.io.

@DevMoore94
Copy link
Owner Author

Using multiple senders seems to be the best option textbelt and blower.io but blower.io is removing their free account as of December so this is our next major challenge. @mkowoods mentioned an algorithm to loop through multiple options to keep texts limits down,

@syntonym
Copy link
Contributor

Just some more brainstorming: Let users "authenticate numbers" i.e. send an sms with carriername to <number>@<carrier>.com and then the user has to input the carrier for that number. Or if the user does know the carrier let him input that somehow.

@syntonym
Copy link
Contributor

Did mkowoods mentioned that here on github? Can you link?

@DevMoore94
Copy link
Owner Author

Scroll close to the top of this issue and you will find it.

@syntonym
Copy link
Contributor

Ah, that one. We still need free APIs to rotate through.

@DevMoore94
Copy link
Owner Author

Yeah there's really no need to sink any money into this project as this point. but I'd like to find a solution that would at least keep it functional. Then maybe the 3 of us could start a new project?

@mkowoods
Copy link
Contributor

I'll take a look at the text belt code base and see what if anything we can adapt from it.

If you guys are ready to start a new project I have some ideas, but would love to hear what you guys have in mind. Certainly enjoying the collaboration

@syntonym
Copy link
Contributor

I posted an idea here but I'm open to most things. Do you want to do another website? Waiting for your ideas.

@mkowoods
Copy link
Contributor

We can also send ta message to all of the major carriers. Unless there's a way to learn carried by number

http://lifehacker.com/127033/send-sms-from-e-mail

@DevMoore94
Copy link
Owner Author

@syntonym that would be a fun application to build if you wanted to create a repository to start that. Also @mkowoods I am fresh out of ideas at the moment haha so don't be shy. What did you have in mind? Also Thanks for looking into text belt.

@mkowoods
Copy link
Contributor

@DevMoore94 yeah i went through text belt repository and it doesnt look like he put the code for sending messages in. I'm fresh out of ideas as well. The carriers make a ton of money on charging for Texts(at least in the US) so they obviously are not inclined to offer the service for free and short of mass email blasting the carriers I'm at a loss for the optimum solution(without significantly scaling up the code base and a lot of research into messaging protocols).

http://www.theguardian.com/technology/2013/apr/29/app-messaging-damages-mobile-text-revenues

@DevMoore94
Copy link
Owner Author

This might mean it's time for a few new projects :)

@syntonym
Copy link
Contributor

@mkowoods The code for sending the messages are in lib/text.js:

function sendText(phone, message, region, cb) {
  output('txting phone', phone, ':', message);

  region = region || 'us';

  var providers_list = providers[region];

  var done = _.after(providers_list.length, function() {
    cb(false);
  });

  _.each(providers_list, function(provider) {
    var email = provider.replace('%s', phone);
    email = 'Subject: Text\r\n\r\n' + email;
    var child = spawn('sendmail', ['-f', '[email protected]', email]);
    child.stdout.on('data', output);
    child.stderr.on('data', output);
    child.on('error', function(data) {
      output('sendmail failed', {email: email, data: data});
      done();
    });
    child.on('exit', function(code, signal) {
      done();
    });
    child.stdin.write(message + '\n.');
    child.stdin.end();
  });
}

It uses sendmail to send an email to the emails of the form <number>@<carrier>.<tld> e.g. [email protected]. The emails are in lib/providers.js.

@syntonym
Copy link
Contributor

@DevMoore94

that would be a fun application to build if you wanted to create a repository to start that

Currently I don't have too much time (as you can tell by my recent (not existent) contributions to TextThem), so I would rather "help" than being the "main contributer". I guess I could create the repo and give you two "admin rights" (or whatever that is called here on github), but I don't know if that would bring any advantages.

@mkowoods
Copy link
Contributor

@syntonym cool. I missed this was looking for something else. So yeah, it looks like he's just using the "email blast" approach and is iterating over the list of providers sending each the same message.

Can you tell if the code is optimized to stop after it receives a positive response?

@syntonym
Copy link
Contributor

Can you tell if the code is optimized to stop after it receives a positive response?

I'm not entirely sure but I don't think so. Also there is an issue that reports getting multiple sms.

@mkowoods
Copy link
Contributor

For what it's worth i did a quick write up of the code in python based on the textbelt approach and using smtplib. In order for it to function it needs to be connected to an actual smtp server... and there may be some additional tweaks. I havent tested it out it;s more pseudo code than anything else.

https://gist.github.com/mkowoods/903c140767483b702f77

@mkowoods
Copy link
Contributor

in the mean time i created this repo to store commonly recurring code

https://github.com/mkowoods/template-dry

@syntonym
Copy link
Contributor

https://gist.github.com/mkowoods/903c140767483b702f77

Looks solid.

Is there anyway to know if an email was successfully transformed to a sms i.e. do you know if the carrier return something if it was successfull? We could then check for that and stop cycling through the list.

@mkowoods
Copy link
Contributor

i found 2 optimization points. There are some lookup sites that will tell you the carrier based on a phone number, but those with API's all charge.

not sure if smtp sends a receipt notification. I imagine it will depend on the provider.

@syntonym
Copy link
Contributor

So kinda dead end? So just move on? Or what do you think?

@DevMoore94
Copy link
Owner Author

As much as it sucks to stop this project. I think we've reached the extent that free can take us. @mkowoods you mentioned you had some project ideas floating around??

@mkowoods
Copy link
Contributor

There are 2 projects I'm probably going to put up on github this weekend.

  1. Turning a Google App Engine Site into a RESTFUL API DBaaS key-value store. It's mostly an educational thing, but I think building it will help future dev projects. I could use feedback on how best to design the API so that it's most effective. i want to use it is a backend for future low scale projects. I need to build all the basic CRUD Functionality and would want to add in some basic security like an API Key tied to a domain

  2. I wanted to make a news feed style site that allow people to post URL's and other things to it either directly or by sending an email to the site and then it's there for people to share with small groups of their friends. It stems from the fact that me and my friends often send links back and forth to funny or interesting things we find on the internet, but we don't necessarily want to share on Social Media so this is a way to build a separate platform. (Probably use flask for this and maybe host on Heroku and then use the backend from 1 to support it)

Both are relatively small projects especially for the 3 of us to tackle.

I'll set up Repo's over the weekend...

I'm down for bigger projects, but wanted to get a couple of smaller one's done. Just to practice and learn new techniques

@DevMoore94
Copy link
Owner Author

@mkowoods I like the sounds of your second idea :) Also do you have an experience with android apps?

@syntonym
Copy link
Contributor

I kinda don't get the first idea. Why not use something like couchdb? On their homepage: regular HTTP for its API which sounds like what you want. But I guess it's more an exercise and the joy of building it yourself.

I also like the second idea. It does sound a little similiar to my idea, with the difference that my app would use websockets (or something different) to have "realtime". Maybe i can fork the code for that later.

@DevMoore94 I would be realy interested in doing python apps for android espacialy via kivy. I played a bit with kivy but never deployed to android.

@DevMoore94
Copy link
Owner Author

@syntonym just quickly looked at Kivy and was wondering if you could give me of an overview of what it is used for.

@syntonym
Copy link
Contributor

Sure! Be aware that I'm not a kivy master and my information could be incomplete or even wrong.

In itself kivy is an GUI framework like PyQt, wxwidgets or TkInter, letting you create a user interface with windows, buttons, labels etc. But kivys big pro is that it runs on windows, linux, macOSX, android and iOS (apple mobile), so you can write your app with kivy and then deploy it and use it on any of these platforms.

If you want more information just ask away.

@DevMoore94
Copy link
Owner Author

So Kivy apps can be compiled to an .apk file and run on android?? that's pretty awesome!

@syntonym
Copy link
Contributor

As far as i know, yes.

For additinal information see this, espacially the following passages:

You can run Kivy applications on Android, on (more or less) any device with OpenGL ES 2.0 (Android 2.2 minimum). This is standard on modern devices; Google reports the requirement is met by 99.9% of devices.

Kivy APKs are normal Android apps that you can distribute like any other, including on stores like the Play store. They behave properly when paused or restarted, may utilise Android services and have access to most of the normal java API as described below.

[...]

The Kivy project provides all the necessary tools to package your app on Android, including building your own standalone APK that may be distributed on a market like the Play store. This is covered fully in the Create a package for Android documentation.

@DevMoore94
Copy link
Owner Author

Reading over this now! and it seems amazing!!

@mkowoods
Copy link
Contributor

@DevMoore94 , @syntonym If you are still interested i started up 2 new projects

the key-value store based on google app engine still need to complete some of the methods
https://github.com/mkowoods/mw-key-val-dev

the news feed service
https://github.com/mkowoods/FeedMyFriends

@DevMoore94
Copy link
Owner Author

@syntonym @mkowoods I was looking into an alternative and any functionality is better than none. I whipped up this little chunk of code and it worked for sending a message. Koodo is the carrier my cellphone is through and they have a webform for anybody to send text. Using the requests library I managed to get texts to send.

import requests
def send_text():
message = {"CODE": "506","NUM":"2278951","CALLBACK":"15062278951","MESSAGE":"THIS IS A TEST"}
r = requests.post("http://msg.koodomobile.com/msg/HTTPPostMgr", data=message)
return r.status_code, r.text

print send_text()

@syntonym
Copy link
Contributor

Does this work for any number, not only numbers by your carrier?

@DevMoore94
Copy link
Owner Author

Yes from my limited testing this works for any number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants