Differences between revisions 6 and 7
Revision 6 as of 2014-07-12 07:41:56
Size: 3364
Editor: JensSuelwald
Comment:
Revision 7 as of 2015-04-21 12:07:34
Size: 4859
Editor: ip-109-90-124-244
Comment:
Deletions are marked like this. Additions are marked like this.
Line 53: Line 53:

==== adding Contacts in irssi/bitlbee using trigger.pl ====
This is a very quick and dirty (not to say security flawed) workaround for adding contacts via trigger.pl and a separate contacts file (work still in progress, cleanup/rewrite more than welcome!). Trigger will be the successful whatsapp log-in as displayed in the control channel output by 'root':

 * create a file with contact information, e.g. '~/.irssi/whatsapp.contacts', with similar content:
 {{{
add whatsapp 1234567890 fancypants
add whatsapp 0123456789 buddy
add whatsapp 9012345678 mother
}}}

 * Get [[http://wouter.coekaerts.be/irssi/trigger|trigger.pl]] and autostart it with irssi
 * Set trigger in irssi:
 {{{
/trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'exec -out cat ~/.irssi/whatsapp.contacts'
/trigger save
}}}

One could just as well create a trigger for each individual contact and avoid using "-command exec …" like:
{{{
/trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'add whatsapp 1234567890 fancypants'
/trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'add whatsapp 0123456789 buddy'
/trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'add whatsapp 9012345678 mother'
/trigger save
}}}

WhatsApp with BitlBee

Since many people seem to be intersted in using whatsapp with bitlbee, here's a rough briefly tested summary of how to get it working. Please send reports of success or any issues to #bitlbee.

Requirements

Caveats

  • You can't use whatsapp from more than one device simultaneously.
  • This might be against the whatsapp TOS, and they might decide to ban your phone number. Your warranty is now void, etc.

  • The registration tokens change often, additional security measures are added regularly, so maybe none of this will work.

Registration

You need to get a password to connect. This password is not the IMEI as you might have read (it was, a few years ago), but you need to extract it somehow from a running whatsapp client, or create a new one. At the time of this writing it doesn't seem possible to sniff it, so, alternatives:

If you succeed at this step, congratulations. Try not to get too desperate if it goes wrong, you might end up with a huge cooldown period. Check the issue trackers of the relevant tool to see if other people have the same issue, as the registration tokens might have changed.

An example of creating an account

  • Get yowsup from https://github.com/tgalal/yowsup/wiki/yowsup-cli

  • Create a config (text) file with the following content only:
    • phone=358500123456
      • where 358500123456 is your sms-capable phone number with country code, without + or leading zeroes
  • ./yowsup-cli -c <configfile> -r sms # request a registration code from WhatsApp

  • ./yowsup-cli -c <configfile> -R <code> # register an account using the code you should have received via SMS

  • You should now receive a message on the console with your new password
  • You can test chatting with yowsup-cli. Add line "password=<password>" on you config file and run an interactive chat with a friend with something like

    • ./yowsup-cli -c <configfile> -i <number_of_a_friend> --wait --autoack --keepalive # See yowsup-cli -h for details

Putting it all together

The next step is to get whatsapp-purple working in bitlbee.

  • Get plugin whatsapp-purple from https://github.com/davidgfnet/whatsapp-purple (If running Ubuntu, you can add ppa:whatsapp-purple/ppa and install package pidgin-whatsapp, or you could just build it from source)

  • If you want, you can try it first with pidgin, since that's the officially supported way to use whatsapp-purple.
  • (Re)start your bitlbee-libpurple instance (remember, the non-libpurple version won't do)
  • Bitlbee command "help purple" should now list whatsapp as a supported protocol
  • Add your account the usual way: acc add whatsapp 358500123456 <password>

  • Add buddies as usual: add whatsapp <number_of_a_friend>

Notes

  • Whatsapp seems to generate a lot of "connection established" and +v/-v -messages, probably due to the underlying library making connections to the server per message
  • Contacts need to be readded after onlining the account again in bitlbee.

adding Contacts in irssi/bitlbee using trigger.pl

This is a very quick and dirty (not to say security flawed) workaround for adding contacts via trigger.pl and a separate contacts file (work still in progress, cleanup/rewrite more than welcome!). Trigger will be the successful whatsapp log-in as displayed in the control channel output by 'root':

  • create a file with contact information, e.g. '~/.irssi/whatsapp.contacts', with similar content:
    add whatsapp 1234567890 fancypants
    add whatsapp 0123456789 buddy
    add whatsapp 9012345678 mother
  • Get trigger.pl and autostart it with irssi

  • Set trigger in irssi:
    /trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'exec -out cat ~/.irssi/whatsapp.contacts'
    /trigger save

One could just as well create a trigger for each individual contact and avoid using "-command exec …" like:

/trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'add whatsapp 1234567890 fancypants'
/trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'add whatsapp 0123456789 buddy'
/trigger -public -tags 'bitlbee' -channels '&bitlbee' -masks 'root' -pattern 'whatsapp - Logging in: Logged in' -command 'add whatsapp 9012345678 mother'
/trigger save

BitlBee Wiki: HowtoWhatsapp (last edited 2023-01-22 21:26:21 by kinlo)