I want to build a web service that sends articles to my Kindle - ruby-on-rails-3

Where do I start?
Is there some sort of API - or something I can get access to that allows me to format articles and send them to my kindle?
I would like to do this in Rails.
Edit: For further clarity, I guess my real question is, how does instapaper.com get articles from the web to my kindle? Can someone explain the technology behind that please and do they have access to the Kindle SDK?

Take a look at Calibre (http://calibre-ebook.com/), runs on Linux, Win and OS X. Python based, has a GUI and a command line, suitable for automation. You can do all kind of conversions to .mobi format as well as fetching news from website and packing it to .mobi, which can be then transferred via USB or sent to kindle email address. It's very simple to fetch & send articles automatically either on a server system with cron or leaving it running on desktop (with GUI) for non-technical users.

Calibre's command line tools are your best bet: http://calibre-ebook.com/user_manual/cli/ebook-convert.html is the call you would most likely be interested in.
I believe all Instapaper does is convert to .mobi format, and then send mail (with the .mobi file attached) to your specified Kindle email address (eg. foo#kindle.com).
If you're more interested in specifics, Marco (Instapaper's author) tends to be very forthcoming when people ask him technical questions. His Twitter account is #marcoarment.

Check out this ruby gem, it seems to do what you want:
https://github.com/29decibel/kindler

Related

Wechat : does an SDK / API exists?

I'm online on wechat (an instant messenger, not to be confused with weechat, that is an IRC client) and following a lot of groups for work. I'm searching for an SDK, an API set, to be able to automitize info collecting from groups and or individuals.
But i'm not aware of any way to do it.
Please, this is NOT an 'opinion' question, I'm litterally asking you if you know a way to receive data from weechat, because I cannot find it.
I see the area on weechat website where a company can ask for accces to API, but, really I cannot find other tools.
Edit 1: Chinese DOC, I think: https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419318183&token=&lang=zh_CN
Edit 2: Chinese DOC more similar to a JS api :http://work.weixin.qq.com/api/doc#10029/%E5%A4%96%E9%83%A8%E8%81%94%E7%B3%BB%E4%BA%BA%E9%80%89%E4%BA%BA%E6%8E%A5%E5%8F%A3
Obviously, use google translator !
As from my OP, there are some docs, official docs, but the real problem is that to create even a simply Mini Program, we need to subscribe (paid) and also paying at one point a chinese-only page asks by country and the list simply does not include Italy, so I simply cannot subscribe.

google home reading from website

I'm currently working on a project where my main focus is to create an Action for Google Home which can be invoked and asked to read out some articles (chosen previously from a list, also by voice) from a particular website.
I was wondering if it was possible, or if it were already some similar projects.
What I'd like to do is something like the feature in Pocket or instapaper, where you can make the device read the article for you.
I also thought to make something like a database with all the articles I'm interested in, which auto-updates itself whenever a new article is posted, but my main concern now is to be able to separate the articles in various lists, parse the article and in the end implement text to speech into the Action.
Also some implementations with 3rd party services and apps would be useful.
Please ask me if anything isn't exactly clear, english is not my first language.
Yes, this is possible. Not necessarily easy, but possible.
First - there is nothing in the Actions on Google library or in Google Home that will automatically scrape a website. That will be up to you.
Second - Responses from your Action are limited in how much they can send at a time.
If you're having it do text-to-speech, you're limited to two "text bubbles" of 640 characters each before the user has to reply. You should keep well below that and should probably stick to just one "text bubble".
If you're playing an audio cut, then you're limited to two minutes.
You can work around both of these limitations by using the Media Response. With TTS, you would play a portion of the text, a brief Media response, at the conclusion of which, your server would be triggered to send the next chunk of text. If it is all recorded, you can just send the longer audio as the Media.
Be advised, however, that if you're using the inline editor or using Firebase Cloud Functions (which the inline editor uses), that by default you're not able to access most sites outside Google's network. You need to upgrade to a paid plan to do so. I suggest the Blaze plan which is pay-as-you-go, but includes a free tier which is typically good enough for development work and light production usage.

CF.NET SMTP/POP3 clients

I'm working on an order entry application targeted to windows mobile devices.
I need to be able to send and receive emails from within the application, but without using pocket outlook (this is a customer requirement).
I see that the .net mail classes are not available for the compact framework. So I need to look elsewhere.
I found 2 interesting libraries: CSLMail and MooseWorks' Email Controls. But none is able to deal with SSL connections, and this is a mandatory requirement
I've found a few commercial email component suites supporting the compact framework, but their price is very high ($200+).
I guess I'm not the only one having the problem of sending and receiving emails - so, my question is: can anyone suggest me any free or low cost cf.net smtp/pop3 library?
Thanks
First, I'll say that when you look at the cost of your time, $200 is a whole lot cheaper than writing it yourself, and it's a small price to pay for something that is done and tested.
On the free side, there is the Smart Device Framework, which contains the OpenNETCF.Net.Mail namespace, which does do SMTP. Still, you're on your own for SSL.
Well, I think ctacke said everything there is to say.....however:
What regards SSL, there is a free component that works on Windows Mobile (and CF.Net) which is called SocketPro (written by Udaparts). You may find further information on this page (from where you can also download it). Have a look also at their forum where you can find examples.
I have successfully used this library in a small application of mine connecting to mail-servers that require SSL. The only exception is GMail which for some strange reasons the SocketPro-library has difficulties to communicate with. However, for GMail I used a version of OpenSSL which I found floating around on the internet which works well with GMail and CF.Net although it is a bit big in size.
Once you have established a connection with your mail-server, you can use ordinary POP3 for retrieving e-mails and SMTP for sending them.
Edit: I should mention that if your e-mails have attachments, then you need to look into MIME as well but that's another story. However, there are free libraries with source-code which can be found on the internet (try CodeProject).
Hope it helps...
OpenNetCF is definitively worth checking. As for commercial components - $200 for the tested and supported code would be probably cheaper than trying to roll out your own implementation or than trying to use some downloaded proof-of-concept code in production environment. Sometimes it's nice to have someone who is paid for solving your problems, anyway.
If you start evaluating commercial components you can try to check our Rebex Secure POP3 as well. It does support both SMTP/SSL, POP3/SSL and S/MIME on .NET Compact Framework. It costs a bit more that $200, though.

Set instant messenger display message programmatically

Would a script that sets display messages for instant messengers be simple or complex? After some searching, there doesn't seem to be any information about this at all.
For the sake of an example, if I had a text file of quotations, would it be possible to have the google talk display message change to a different quotation hourly?
Depends on which client you're using. As far as I know, Google's client doesn't offer any interface for plugins, but the open source instant messenger Pidgin does. I think there already is a plugin for what you want to do, but you can write your own using the documentation and examples they give you.
The complexity of writing something like this is based on how much C or Perl you know, since you can program in either of those for Pidgin. Reading code from other people's plugins, you should be able to figure out the Pidgin API.
You can use Kik API to programmatically send rich content and files between mobile applications. It is available for iPhone and Android platforms and takes only about 5 lines of code to integrate into your app. There is more info at the API website: http://www.kik.com/dev
Disclaimer: I'm on of the developers behind Kik API :)

How would you go about making an application that automatically retrieves your bank account balance twice a day?

I'm building a utility that will hopefully keep my wife in tune with how much money we have available.
I need a simple secure way of logging into my bank account and retrieving the balance.
Something like mechanize is the only method I can think of. I'm not even sure if that would work given the properly authenticated https that banks use.
Any ideas?
Write a perl script using LWP::UserAgent. It supports HTTPS connections. The only issue might be if the site requires javascript.
Web Client Programming with Perl has a few examples to get you started if you're not too familiar with perl.
If you really want to go there, get these extensions for Firefox: Live HTTP Headers, Firebug, FireCookie, and HttpFox. Also download cURL and a scripting language that can run cURL command-line tasks (or a scripting language like PHP or Perl that has access to cURL libraries directly).
I've started down this road for some idempotent GET tasks like getting PDFs of the S&P reports (of the stocks I track) from my online brokerage, and downloading the check images for my bank account. Both tasks are repetitive and slow ways of downloading data to my computer that the financial institutions don't provide any way of making it easier.
Here's why you shouldn't: (as a shortcut I'm going to call the archetypal large bank, brokerage, or other financial institution "BloatBank")
BloatBank is not likely to make public their API for accessing this kind of information. So it can change any time and all your hard work will be for naught. Whenever they change their mechanism, you'll have to adapt.
If BloatBank finds out you've been using automatic scripting to try to access your account information, they may ban you because you've violated their terms of service.
You might screw up, and the interaction between the hodgepodge of scripts on BloatBank's server, and your scripts that access your account, might cause a Bad Thing like closing your account. Testing this kind of script is tremendously difficult because you don't have any documentation about how their online service works, and you don't have a test account you can mess with.
(a variant of the above) You think you're safe because you're issuing GET requests. But BloatBank is just a crazy bank that doesn't know anything about REST, so there are some GET requests that can mess up your account.
If someone else does use your script to maliciously sniff your online password or mess with your account, any liability coverage from BloatBank may disappear because you've opened a security hole.
Why don't you teach your wife how to login to the bank herself? Or use Quicken (or Mint, etc) and teach her how to use the auto-download feature?
Have you checked out Watir? It is fantastic for automating web-browser actions. And since it's written in Ruby, you can take the results and store them in a DB (or email them to yourself) if needed.
If you are open to AIR, I'd say build an AIR app. I have worked with mechanize and I think it's cool. AIR gives you similar features with a richer GUI (see HTMLLoader and DOM manipulation of webpage).
If I were you, I'd simply pull the page and manipulate the DOM to suit my visual needs.
Please, if you find this easy to do for your bank please post your bank's name. If I have the same one I'll be closing my account.
More to your question. The process of loading a web page inside of your code rather than in a browser can be a black art, especially if their is any javascript involved. Your best bet would probably be embedding the IE Web Browser control in your app and then simulating key strokes and mouse clicks to arrive at your balance page. Then scrape the HTML for the balance.
I could try paying for Quicken and letting it do the balance downloading. Then I'd just need to find a way to get the number out of the software automatically.
This way I'm not violating any terms of service and I'm also reducing security risk since all "hacking" goes on locally.