How to create an IM bot with C# - c#

Is there an easy way to create an IM bot on multiple im networks (aim, gtalk, yim, etc) that can accept and interpet specific commands sent to it to perform a server related task?
Lets say for instance I have a website for managing an rss feed. I want to send a command to an IM bot to add another feed to my collection. the IM bot would associate my screen name with my account from prior setup on the website.

I have done some internal bots for my company using the XMPP (Jabber) protocol, I've used the agsXMPP SDK and the Jabber.NET client libraries, I was looking for APIS to work with YIM, AIM and Windows Live Messenger but I've found only COM exposed APIS, nothing for .NET...
But an idea comes to my mind, with the XMPP Protocol you can configure a local server with IM Gateways, that allow users to access networks using other protocols through your server
I use eJabberd, you can install a variety of transport gateways to connect with other IM protocols (AIM, MSN, ICQ, GTalk...
To GTalk you can connect directly using the libraries I mention...
A sample ICQ gateway:

The short answer to this question is yes this can be done relitivly easily. Sedning and receiving IMs sending, receiving and interpreting requests from the network you wish to communicate on and there are libraries available for each of the major IM protocols to make this easier.
For messenger you can try the DotMsn library, I have used it in the past but at that time it was still quite new and I have not used it since so I can't vouch for it's quality.
Jabber uses the XMMP protocol which is an open-standard so there are bound to be plenty of client libraries available.
If I recall correctly Google Talk uses this protocol or a modified version thereof.

I dont have experience with c# but I have written one for AIM and Gtalk using PHP. http://www.imified.com/ is the best place to start if you looking for a easier way to write an IM bot.
Basically you create an account in imified.com .
Name your bot and link a script.
When ever a message is sent to the bot, imified.com automatically runs this script.
Here is a link for you get you started!

We have professional .NET/COM/VCL library for MSN/Yahoo/ICQ/AIM/GTalk/Jabber. Please take a look at http://www.imcomponents.com/ if you like.

Related

Sending a data from android phone to pc?

I am creating a "tracking system" for my android phone. Basically, the phone would transmit it latitude/longitude to a C# program that will receive the coordinates and display it on a map. I managed to get the phone's latitude/longitude coordinates but I need a way to transmit that data to my C# application running in my PC. I know my way around C# and Java but never really got into network programming. Is there a way to do this ?
I'd look into C# Webservices, very powerful. The communication protocol is SOAP (Simple Object Access Protocol) which is a popular and well supported standard.
Good starting reference: Your first C# Web Service
I can't speak to the C# side of it, but if you write a C# server to receive post requests, the Apache HttpClient makes it relatively simple to send requests. There are a bunch of other questions on SO that will help with setting up the client side on your phone if you poke around a bit.
You have different way to do it.
The first is to send data over the cloud to interact through distant server. So the both devices have to be connected to Internet
The second id to send the data over a local network so the data have to be on the same network and have to share their IPs
The third is to use adb forward which allows to build a socket connection between the 2 devices over a USB cable. The requirements are that the phone have to be on debug mode I think and that the driver are installed on the PC so the phone is recognized by ADB.
I can add one more by using a Bluetooth connection. Find information here
The correct way to do it would be to build WCF service which allows many different protocols to receive data. This would could be a very powerful solution that can be extended in future.
The fastest and easiest IMO would be to create ASP.NET MVC application, define a POCO Model for your longitude/latitude and create an action that would take your Model as parameter. Then use HttpClient and HttpPost on android to send the data. The trick here is to name the variables in your post request same as ones you define in your C# Model.

facebook like chat application in ASP.net

I want to build web based facebook like lightweight chat for my site.
Website build on ASP .net on SQL server 2005.
I am interesetd in XMPP commmunication, but not able to find open source XMPP server with supportedlibrary for C# so that I can create client for my site.
Have checked googling butno luck for C# library; all I could found is plugin and jar.
Is it possible to implement chat logic and XMPP server communication in different language, and accessing thisdata through iframe or by other means on my site.
Thanks,
Hitesh.
http://www.ag-software.de/agsxmpp-sdk/
That library seems to be pretty good.
What you'll want to do is follow jgauffin's suggestion, and use an XMPP library on the backend, and then typically you'd add in a comet server for integration with your web frontend (we've actually done exactly this # Frozen Mountain, using WebSync).
If you're building a smaller site and/or don't need the "realtime" aspect, you could probably get away with polling as well, in which case you'd need to store the results from the XMPP library in your own system, and poll that (since XMPP is strictly event driven).
There are many options to send a message since first human! But how about the intelligence on it, automated collaboration in object level or shared objects among the users etc. I suggest you to take a look for the samples in here and feel the difference.

XMPP C# Interaction

I am trying to connect via c# and via javascript to an xmpp server (currently ejabberd). Im having a little trouble conceptualizing how the connections will exists.
Backstory: I have a game engine that will take input from the user and send some kind of response back to them. The user may be a windows app, a web app, all needing to connect pretty much the same way. The game engine is a c# application that handles the input accordingly. Is my game engine a user on the xmpp server just like everyone else? How does he talk to the others and vica verca. A detailed tutorial on how this kind of thing is done using xmpp is greatly appreciated if possible.
Are there c# libraries to handle the xmpp connection in the way I specified above? Would the javascript also be hitting the xmpp server in the same way?
Your game server would be an XMPP component which your users could directly communicate with, like they can with any other user, server or component in an XMPP system.
Users log into your server (say example.com) in the standard way, then they can start sending messages of whatever type you like directly to your component (game-engine.example.com). Your game engine component exists separately to your XMPP server and the two communicate using the Jabber Component Protocol. Your client can also send directed presence to the component if you want it to be able to initiate communications.
Though, as you're using ejabberd, you could also implement the game engine messaging system as an ejabberd module.
This probably answers your question about a C# XMPP library: https://stackoverflow.com/questions/1166252/net-xmpp-libraries-under-apache-mit-or-ms-pl-licenses

Creating an IMAP client application in Silverlight

I'd like to make a stripped down email client for my pre-schooler using Silverlight 3 and pulling email from a Gmail account.
I'll have some filters setup in Gmail so that only a subset of email is given a particular label, similar to creating a whitelist. Then, I'd like to pull those emails with that label to the Silverlight client. I'd like to avoid running any of the messages through the server (so that I can share this application with friends and not have their email app require a server).
I've never written any sort of email client (POP3 or IMAP) and am not sure if this will even be possible. Looking through the various libraries available for retrieving via IMAP, I can't find references to using a browser-limited client such as Silverlight.
Also, I'm guessing I'll be able to send via .NET built in SMTP objects in Silverlight, but haven't tested this yet either.
Can anyone point me in the right direction; tell me why this may or may not be feasible; or relate their own experiences regarding this type of challenge?
Silverlight does not yet allow arbitrary socket connections, which you would need to connect to an IMAP server on the privileged port of 143. Silverlight can only connect to servers, even with a client access policy file, on ports 4502-4534.
Your only options are to proxy to gmail via a server on those ports, or just do the IMAP work on the server and serve it down to the client app over HTTP.
Sorry about this-- enhanced socket support is always being looked at, but it has scary security implications and hasn't been implemented yet. Good luck finding a solution to your scenario.
There is a great example of a Silverlight based mail client here:
http://silvermail.com.au
I use this regularly to check my personal email from work, and I know that it works with GMail.
Hope that helps.

Track messages though Windows Live Messenger

I would like to track messages sent and received though Windows Live Messenger. I would then like to collate these messages into a database (not in the scope of this question).
The question is how and where should I track these messages. The simplest way it to force all clients to keep history files and read those, but it is not really the solution that I am looking for. Is there a way to track them from a server running in the same domain, I have read a little into Windows Communicator, I have also seen a lot of people chat about http://dev.live.com/messenger/ but I was hoping that someone may have addressed this problem already :)
I would like to do this using C# .NET 3.5
Check out MSNPSharp. Its a .NET msn library. Its very powerful and allows you to sign in from multiple locations. So you can sign in and listen to other conversations happening on a given account.
Its very straight forward to use. Download the full source code, there's a sample application that demonstrates its use in full detail.
http://code.google.com/p/msnp-sharp/
Here is two idea that might work.
The first one is the easiest but can be easily avoided by the user if he doesn't want to be logged. It would be to use MSN Plus over the MSN. With MSN Plus you have an API that let you get all messages from any Chat Windows... and a lot more. Of course, if the user is not you, the user can simply uninstall Msn Plus and your program will not log any data.
The second idea is better if you have a network that you require to check all Msn Conversation. If you use WireShark you can see that conversation are not crypted (well the last time I did it) and you can check the port and protocol to simply get the data from the network.
Hope it gives you a way to what you need.
Just two ideas
1. First the standard MSN protocol is plain text (from what I understand) so you could intercept the messages on the firewall and then put them in the DB and do the correlation there.
2. If this is in an organisation you could use Office Communicator which is the "corporate" version of MSN and has that functionality built in already. You can then just go in via their SDK and get the correlated data.
I managed to find two ways of doing this, though both are not really programmatic solutions, so may not appeal to this audience.
Make use of a Jabber gateway to set up forwards between your jabber client and the other IM networks. Traffic flows between your jabber enabled client and the jabber server via the jabber server. The Jabber server then translates this to the destination networks protocol and forwards the message. Likewise messages from the external IM networks are routed and translated by the Jabber server. An example of this is PSI <-> IceWarp Merak <-> MSN
Make use of Symantec IM Manager to intercept messages from the messaging clients on your network. You will need to either use host files or local DNS rules to convince the your local PCs that Messenger.hotmail.com is actually located at 192.168.0.59 and not at Microsoft.
Hope it helps other people that may want to do the same.

Categories