Twitter push notifications using Spring Social .NET - twitter

I'm using Spring.NET Twitter extensions in an application. Instead of querying in a loop for twit updates (pulling), I just want to listen to twits of interest (hashtags, # mentions, keywords or updates in timeline) and receive push notifications as they come. So I think the way to do it is to use an event model such as Observables, however, I can't find anything in the API to handle this nor any samples to demonstrate it. I would appreciate if anyone can put me in the right direction for this functionality. Thanks.

Spring Social Twitter only recently started supporting Twitter's streaming API. But that's for Java and your question is about SpringSocial.NET. I doubt that SpringSocial.NET has support for this yet. But I'll ping Bruno (the SpringSocial.NET project lead) and see if he can chime in here.
Until SpringSocial.NET supports Twitter's streaming API, your options are to continue polling (which is non-ideal due to rate limiting concerns) or to implement streaming support on your own. I'm sure Bruno wouldn't mind a pull-request to add streaming support to his project. :)
To be clear, SpringSocial.NET is not the same project as Spring Social and the two projects are only loosely related (in that I know who to email if there's ever a question about SpringSocial.NET).

Rx will just allow you to expose Push based API nicely. If the API does not support Push then you could use Rx to Fake Push by doing polling but expose it as if it was push (Observable.Interval or Schedulers etc).
You first will need to find how Twitter exposes Push based notifcations. If your Client (Spring.NET Twitter Ext) does not support this you are stuck with polling (via Rx or not).
It appears that you want to look at Twitter Streams API (https://dev.twitter.com/docs/streaming-apis)

Related

Twitter StreamingAPI with Pusher

I am working on a project, which has a few dependencies. I would like to have your insights and best practices on a few matters.
Which is the right Twitter Streaming API to get the tweets from the authenticating user?
Does it make sense to hook that streaming API to Pusher and hook my Arduino on Pusher as well?
What is the best library to hook the streaming API to a Laravel backend?
I sincerely hope that this question is within the rules of StackOverflow, as I am not sure. I would really like to gain this information.
https://dev.twitter.com/rest/reference/get/statuses/home_timeline
You can definitely easily hook an incoming feed from Twitter up with Pusher (see next answer). And Pusher does have an Arduino library that should help you too.
Pusher has a solid PHP library so it will be easy to publish data from a Laravel application. The tricky part may be consuming the Twitter streaming API from Laravel and PHP.Phirehose claims to offer access to the streaming API from PHP.
If you could consider other technologies then there's an in-progress Pusher + Twitter Streaming example that you could look at written in Node. There's also this older example that uses Python.

Is combining Parse.com API with Pubnub a viable option for large scale Real-Time Messaging and obtaining the combined toolset?

Essentially combining Parse with Pubnub, Pusher or similar, Instead of building a custom backend from scratch.
I'll be working on a real-time messaging system with facebook login and file storage/sharing. In theory I could use a combination of Parse and something like Pubnub to cover backend requirements. Were:
Parse takes care of:
Login
File Storage
Push-notifications(closed app)
And Pubnub takes care of:
real
time delivery of messages...
Requirements:
I need a system that can extend to millions of users if needed and can be deployed quickly
In general a solution that will fit this criteria and specs.
Criteria:
Quick deployment by one or 2 developers.
Can expand to millions of users.
High reliability
Specs:
FB Login
Realtime Msg delivery
Push for closed app delivery
Shared file & image storage
Any feedback if this as a first stage deployment would work well and any pitfalls would be greatly appreciated.
I'm a little biased but check out StackMob (www.stackmob.com), with the StackMob Marketplace you get direct access to PubNub with no need to create a second account. There are also a lot of other great services in the marketplace to add functionality such as SendGrid.
All the features you are looking for are out of the box even the separate development and production accounts. Something you don't get with Parse. With a simple click of a button you can move Schemas and custom code from development to production.
We can certainly support the users you are talking about. We have 7 games from Atari on the platform and other big enterprise like Land O Lakes and Adidas Japan. We also have a great track record when it comes to reliability.
Sounds good, but 2 systems (Parse and PubNub) contradict your criteria Quick deployment by one or 2 developers.
There is reason to find one system which satisfies all your requirements.
You could loot at QuickBlox backend - your own cloud backend
It has 7 modules(sets of API) for different tasks. You may be interested in:
Users module - it has Facebook/Twitter login
Messages module - this is Push Notifications. It supports iOS, Android, BlackBerry, WindowsPhone push notifications
Content/CMS module - it allows to store/share/stream any type of files, any size (up to 5 TB!)
Chat module - realtime message delivery. QuickBlox Chat is a quick and reliable chat solution which combines benefits of scalable cloud hosted XMPP chat server, seamless Single Sign-On authorization via Users module, incoming IM / chat alerts via Push Notifications and file attachments via Content.
I recommend look at it, it also have lots of great features such custom API creation via Custom Objects module
Also, there is Enterprise solutions - QuickBlox this is white box, so you can deploy it to your own server and re-sale to other clients if you want
The short answer:
no.
The details:
Anyway you hash it, it's too expensive to setup a chat with any of these systems since their BaaS model is based on charging on a per number of calls basis.
I had to work out a lot of the logic my self using parse.com and now that I'm implementing an XMPP solution, the quantity of work is the same to get something working.
My alternative solution:
Use an open source xmpp server like ejabberd on something like AWS and then use one of the APIs to connect to it.
Contact me of you need more info on my experiences:
#andrescanella

Using XMPP as a push server?

I've been running around in circles the past few days trying to figure out a good solution for my problem. The main key here is that this is for an iOS application. What I want is to quickly communicate from one device to another device updates. So if user 1 performs an action, I want to, in real time, tell user 2 that user 1 has performed this action.
I don't want to use Apple Push Notifications for various reasons. So that's out of the question. I looked into services like Pusher and PubNub, but those are far too expensive (and only allow a ridiculously low number of concurrent connections, ~2500). I also looked into Google App Engine's Channel API, but it works through Javascript, and would have to be implemented using shady techniques on iOS. And honestly I'd rather not use that.
So now I'm looking into XMPP in Google App Engine. It seems like it would do what I want, but I'm not sure if I'm understanding the whole picture. Couldn't I accomplish what I wanted using XMPP messages, that is when user 1 performs an action, I can notify user 2 quickly with a JSON message?
The main key here is that I would have to perform user registration for XMPP behind the scenes, using the user's unique ID. Is this possible, to automatically and without user intervention create a Jabber ID like user-unique-id#my-app-engine-domain.com?
Overall, is this a feasible solution? What am I missing? What are some exceptions?
What you have described all sounds fairly easily doable with XMPP.
Just a couple of points.
You do realize, of course, it is XML based, so your JSON messages would be embedded within XML stanzas, with appropriate escaping when necessary.
Your user registration would be determined by the server implementation, but I believe most will allow custom authentication hooks (like LDAP). So having an external registration mechanism shouldn't be a problem and is a fairly common approach.
Since you are using ios, you should be looking at XMPPFramework as your XMPP library.
Depending on your use case, you may want to look at XMPP pubsub as well for your updates, depending on how many other devices are supposed to get the message when one makes a change. I have used this approach and it works well for real time client to client updates.
AppEngine supports XMPP only as client: it can send and receive messages. The key here is if you look at the docs for sending XMPP message, that every client needs to have it's own address (JID) which is not provided by GAE.
So to support your situation, you would need to have an external XMPP server, where every client gets it's own JID and then you can send XMPP messages to them.

How can I get twitter running on my local server?

I want to put the Twitter service on my server and customize it for my purpose. I have no idea how it works.
My goal is to communicate to your own Twitter server rather than the original twitter server and serve my purpose.
You should check out: StatusNet. It is an open source micro blogging platform. From their site, you can download the source and deploy it on your own server. Once you have it installed you can customize it to your liking.
Twitter isn't an Open Source project - they don't provide their server code.
From my experience at another company deploying very widely distributed systems, the chances are there's a bucket-load of infrastructure you'd need to get running first - complete overkill for a single-server solution, but vital for a global service with many millions of users. In other words, even if Twitter did provide their code, it probably wouldn't be an appropriate solution for your situation.
The actual Twitter (twitter.com) service is proprietary, you can't run it yourself.
There are plenty of open source twitter clones out there. The more general name is "microblogging". Pinax for example has basic microblogging. Try searching google for 'open source microblogging' for other projects.
I don't believe the Twitter platform is freely available to the general public. If you want to make your own "Twitter server", you're going to have to clone the service yourself.
You can't run Twitter on your own server, but you can write your own application that talks to Twitter through Twitter's API.
It all depends on what you mean by "customizing" Twitter. There are many applications like Twitpic and TweetDeck that are built "on top of" Twitter. They add their own functionality while leaving Twitter to do the "heavy lifting".
For example, I have written a personal project for moderating a stream of tweets. This application runs on my local server, but it gets its data by querying Twitter's API.
There are two main advantages to extending rather than rebuilding Twitter:
It takes a lot less effort because you can reuse all the basic functions of Twitter
You can take advantage of Twitter's huge user base. Even if you succeeded in cloning Twitter, it would be far less interesting than the original because Twitter works by strength of numbers.
You could use Wordpress and get the twitter developer add in then get a api code from them and there users can use your site and vice versa also apps for twitter will work for your site.
Wow. That's a highly ambitious request that you have there. Twitter isn't like Wordpress, there's no .org version that can be downloaded and run locally. Twitter is a highly scalable service that is designed to run on large scale servers.
Sorry to be the bearer of bad news to you on this.

How to provide your app with a network API

I am going to write a Ruby application that implements a video conversion workflow consisting of multiple audio and video encoding/processing steps.
The application interface has two core features:
queueing new videos
monitoring the progress for each video
The user can access these features using a website written in Ruby on Rails.
The challenge is this: I want make the workflow app a self-sufficient application, not dependent on the existence of the web view.
To enable this separation I think that adding a network API to the workflow application is a good solution because this allows the workflow app to reside on a different server than the web server.
My question is: Which solution do you suggest for such a network API?
A few options are:
implement a simple TCP server and invent my own string based API
use some sort of REST api (I don't know if this is appropriate for this situation)
some sort of web-services solution (SOAP, XML-RPC)
another existing framework
Feel free to share your thoughts on this.
I would suggest two things:
First, use REST as your API. This allows you to write one core application with both a user interface and an API for outside applications to use.
Second, take a look at PandaStream. It's a Merb application that encodes videos from multiple formats into flash. It has a REST API, and there's even a Rails plugin so you can integrate it with your application. It might be a good example codebase, or even a replacement for the one you're trying to build.
Hope my answer helped,
Mike

Resources