How do I use Telegram API without a bot? - ruby

I don't need a reply bot.
I want to just make a read-only call to read the channel history. Probably I need †he method https://core.telegram.org/method/messages.getHistory but documentation https://core.telegram.org/api#getting-started does not even explain the protocol.
The protocol as I understand is pretty custom and I should use some minimal wrapper but all examples/articles I've managed to find link to https://github.com/atipugin/telegram-bot-ruby but I don't need a bot.

To use Telegram without a bot you should work with Telegram low-level protocol MTProto. There are MTProto libraries for Python, JavaScript and even for PHP. See examples of getting chat history with those libraries here, here and here
But it seems that there is no Ruby gem for this - bad luck, you should either create MTProto Ruby gem yourself, either move this functional to another service written in language that has MTProto library.

You can use tdlib-ruby
gem 'tdlib-ruby'

Related

Gmail Api Mail Read Reciept

Is there a way to way to get read receipt of sent mail?
Like which mail is read and which one is unread?
Using google apis Rest.
Read Receipt is no available in current version of google mail api.
provide third party solutions.
As of now Read reciept is not available.
but you can always write custom code to implement task.
Well, if you check the Gmail API documentation you cannot find any guides here that can achieve this. I found here a related SO question that try to use Apps Script in achieving this, but it seems that the Apps Script is also not applicable. I suggest you to file a feature request about this if you still want to do it with the Gmail api.

Making a Facebook API

First off let me state this is HOMEWORK for school. I am looking for general ideas and direction, not "this is exactly what to write". We did not really cover API's so I am trying to learn as I go.
I have been asked to design an API that can be used with Facebook, for things like posting on my feed or adding new friends. I have been doing tutorials online and most seem to have me add some "ruby gem" that has whatever websites methods and stuff. For example I did a Twilio.com demo that needed require 'twilio-ruby' and a twitter one that needed require 'twitter'. To my understanding, these are "gems" and not "API's" correct? That being said, is Koala an API or a simply a gem that contains the methods I need for writing an API (specifically for Facebook)? If I were to use Koala and it was an API, I feel that would sort of defeat the purpose of writing an API (just reusing their methods and such).
Any other ruby API Facebook help would be greatly appreciated!
Have a look at https://developers.facebook.com/docs/other-sdks Koala is listed as "other" SDK, meaning that it provides a wrapper around the low-level Facebook Graph API requests. So, no, it's not an own (web) API IMHO.
In a narrower interpretation, an API is just an "application programming interface". This would not necessarily have to deal with being accessible for example via a REST interface. I think it depends on the definition of API, respectively what you professor expects. If this is unclear, I'd check back with him/her.
Check
http://en.wikipedia.org/wiki/Api
http://en.wikipedia.org/wiki/Web_API
http://en.wikipedia.org/wiki/Representational_state_transfer

OmniAuth/OAuth Authentication from a ruby script

Is there a way I can test out the OmniAuth authentication from a standalone ruby script?
Every resource I could find on web lists its usage only in Rails project.This link too: http://www.omniauth.org/
In other words I could not find any client like this FitGem. The fitbit API uses Oauth authentication.FitGem is a client inteface to test out the authentication/authorization to FitBit using OAuth token.
More details here on FitGem: http://www.fitbitclient.com/guide/getting-started
Thanks.
I realize this is old, but I came across it whilst googling so others might also. Maybe this will help the next passerby...
To answer the question - no, it isn't possible to use OmniAuth within a simple, standalone script. What froderik said is correct, OmniAuth was designed to be used within an app on a rack-based framework (Rails, Sinatra, Pakyow, etc.).
To expand on that just a bit though, OmniAuth relies on the ability to intercept and send HTTP requests to/from your app. By default, OmniAuth intercepts requests to /auth/:provider to kickoff the authorization process and will then send callbacks to either /auth/:provider/callback or /auth/failure depending on the outcome of the auth attempt.
Obviously, that functionality is beyond the scope of a standalone script. But if I were to recommend a solution for writing a quick test using OmniAuth, I'd recommend Sinatra. It's certainly not the only solution (any rack-based framework will do), but it provides the needed functionality with minimal overhead.

Ruby Email Client Recommendation

We are writing an email web client in Ruby to handle (potentially international) emails. I am looking for a high-level email library that supports retrieving emails, parsing email raw, decoding MIME, and converting input into UTF-8. Is there a library that you can recommend?
You can try any of these:
TMail
Action Mailer
RubyMail
If you want to re-invent the wheel, there is the native Net::SMTP class. In another StackOverflow thread, there is a good proof of concept of this.
My favorite library for handling mail is MailFactory
Ruby comes with net/imap and net/pop to handle retrieving mail.
Check out also:
https://github.com/wmorgan/heliotrope
http://github.com/wmorgan/turnsole
Very promising "mutt"-like e-mail client written in Ruby!

User sign-up with email verification, and authentication in Ruby

I'm trying to make a web app in Sinatra, and I was wondering if there was a good solution for user sign-up with email verification, as well as authentication - perhaps as rack middleware? OpenID support would be nice to have too.
I suppose I can roll my own, but I didn't want to reinvent the wheel. If I have to do so, can anyone point me to the libraries I might want to use, maybe even example code? I'm also worried I might end up forgetting to implement something important with signup/authentication, since I've never done this before.
In case I need a homemade solution, I've found bcrypt-ruby for password encryption and Sinatra::Mailer or Pony for email. For signing on with OpenID support, there's hancock and hancock-client, though I'm not entirely clear on usage and I don't actually need single sign-on support. Maybe I should just use a ruby openid library? Do I need anything else?
This is a pretty muddled question, but I hope someone more experienced can point me in the right direction.
You might be interested in Authlogic. You'll need to implement the e-mail verification yourself, but it will provide you with a good foundation for supporting this.
Authlogic can be
used in any ruby framework you want:
Rails, Merb, Sinatra, Mack, your own
framework, whatever. It’s not tied
down to Rails. It does this by
abstracting itself from these
framework’s controllers by using a
controller adapter. Thanks to Rack,
there is a defined standard for
controller structure, and that’s what
Authlogic’s abstract adapter follows.
So if your controller follows the rack
standards, you don’t need to do
anything.

Resources