fuuslack

fuuslack

useless crap slack stuff.

Send messages to both Slack and Twitter.

Would like to add messages i reply and responces but don't want to get in trouble with organisers.

In [3]:
import slacker

from TwitterFollowBot import TwitterBot

import getpass
In [7]:
myusr = getpass.getuser()
In [ ]:
 
In [8]:
my_bot = TwitterBot('/home/' + myusr + '/config.txt')
In [ ]:
 
In [9]:
opslkey = open('/home/' + myusr + '/Downloads/slacker.txt', 'r')
In [10]:
rdops = opslkey.read()
In [11]:
stslack = rdops.strip('\n')
In [12]:
slack = slacker.Slacker(stslack)

# Send a message to #general channel

# Get users list
response = slack.users.list()
users = response.body['members']
In [13]:
lusr = len(users)
In [14]:
lusr
Out[14]:
38
In [15]:
slms = slack.search.messages('irc')
In [16]:
matlens = len(slms.body['messages']['matches'])
In [17]:
matlens
Out[17]:
16
In [18]:
for mlen in range(0, matlens):
    print(mlen)
    print((slms.body['messages']['matches'][mlen]['previous']['text'][0:90]))
    print((slms.body['messages']['matches'][mlen]['previous']['username']))
    #Got in trouble for tweeting others slack messages so disabling this and just 
    #using 
    #input to send messages to both slack and twitter. 
    #my_bot.send_tweet(slms.body['messages']['matches'][mlen]['previous']['username'] + ': ' + (slms.body['messages']['matches'][mlen]['previous']['text'][0:90]) + ' #lca2016')

    print((slms.body['messages']['matches'][mlen]['text'][0:90]))
    print((slms.body['messages']['matches'][mlen]['username']))



    print((slms.body['messages']['matches'][mlen]['next']['text'][0:120]))
    print((slms.body['messages']['matches'][mlen]['next']['username']))
    #my_bot.send_tweet((slms.body['messages']['matches'][mlen]['username']) + ': ' + )
0
is everywhere
kathyreid
I thought it was one of those split brain things like IRC
brong
one kathyreid doesn't know what the other one knows
brong
1
it's an interesting mix, I must say
dtbell91
A brief comment on security of gateways to xmpp and irc.
Irc supports ssl so the server to
dns
johndalton: but can you speak fluent RFC 7162?
brong
2
kicks <@U0JT16M63|dtbell91> from the channel
mattcen
fine, I'll go back to IRC. they didn't kick me :stuck_out_tongue:
dtbell91
to be fair, there ~is~ a sign on your back…
itgrrl
3
I think it’s not the worst thing to let the Slack and IRC groups self-form. People might f
tennessee
well currently the IRC channel is 90% complaints about the slack UX :stuck_out_tongue:
gm
And the slack channel is comments about IRC and IRC/XMPP client integration.
mattcen
4
For now, I'm not enabling it.
itgrrl
i’m surprised that slack even allows plaintext IRC connections...
gm
<@U0JT16M63>: I'm still upset that the rego wouldn't let me have my favourite shell set as PowerShell.
ctudball
5
<@U0JT16M63>: Yes. I don't understand the security implications of either yet.
itgrrl
gateway sounds like it allows one person to connect over another technology (XMPP or IRC) 
dtbell91
dtbell91: Yes, two different thing.
evmcl
6
I'm sure others see the inability to do those things in IRC as a feature.  :-)  We all hav
itgrrl
Would it be possible to turn the IRC gateway on, if it isn’t already? :simple_smile:
parisba
I like to use Slack from my IRC client (and disregard all the arguments :wink:
parisba
7
Probably on Facebook  ;-)
itgrrl
<@U0B0TGGS2>: Sorry, I was referring to the IRC gateway to access Slack (instead of the XM
evmcl
I hope this works, I do enjoy using Slack personally ¯\_(ツ)_/¯
dtbell91
8
<@U0K0K1RMX>: I have no involvement in the running of the IRC channel so can't comment on 
itgrrl
heh, just checked the wiki… apparently we have a facebook page? and nobody complained abou
gm
<@U0K0JM96V>: lol
itgrrl
9
as for the specific complaints about “it’s not FOSS”, i think the wider community’s views 
gm
Okay, fair enough. I assume that's the same for the IRC gateway, which would have been my 
evmcl
<@U0K0JM96V>: I don't really buy it when ppl make that argument—the 'conversation' and info is already split between IRC
itgrrl
10
hello!
msmarymac
re the IRC bridging above, it might be worth discussing
gm
Hey <@U0B0TGGS2>, thanks for setting this up. Any chance of turning on the XMPP gateway? Then I could use Pidgin which h
evmcl
11
Hi all!
<@U0B0TGGS2>, thanks for the invite!
a.kuplev
croy: a bouncer is basically something that you leave logged in to IRC permanently, even w
yjmbo
oh right
croy
12
reads the email thread... hah
brong
FastMail moved from IRC to slack recently (we still run some ops stuff in IRC, so I have t
brong
followed by a decent mobile experience that doesn't fricking ding every time you change networks like andchat used to
brong
13
it's worth reminding everyone, just because this isn't an 'official' conference Slack, the
dtbell91
much the same as it applies on IRC, Twitter, email, etc when in relation to conference eve
dtbell91
Yes, thanks David. Good reminder.
itgrrl
14
<@U0B0TGGS2>: and/or slackin for auto-inviting people? <https://github.com/rauchg/slackin>
glasnt
I'll take a look at slackin when I get a chance. Not sure IRC mirroring is a good idea in 
itgrrl
of course VLine do free travel when I take annual leave... after all the complaining and "feedback" I've provided them o
dtbell91
15
w00t!
itgrrl
I don’t know why I prefer Slack to IRC, but I just do.
tennessee
I think I’m going to be arriving midway through Monday, trying to work out if it makes sense to arrive midway through a 
tennessee
In [172]:
(slms.body['messages']['matches'][0]['next']['text'])
Out[172]:
"followed by a decent mobile experience that doesn't fricking ding every time you change networks like andchat used to"
In [173]:
schli = slack.channels.list()
In [174]:
for slchan in range(0, len(schli.body['channels'])):
    print(slchan)
    print(schli.body['channels'][slchan]['name'])
0
_newbies
1
bofs
2
general
3
random
4
transport
In [22]:
poswhat = input('What to post: ')
What to post: Hopefully this is sent to both slack and twitter.
In [23]:
slack.chat.post_message('#general', poswhat, as_user=True)
Out[23]:
<slacker.Response at 0xb20321d0>
In [24]:
my_bot.send_tweet(poswhat + ' #lca16')
Out[24]:
{'contributors': None,
 'coordinates': None,
 'created_at': 'Thu Jan 21 11:58:19 +0000 2016',
 'entities': {'hashtags': [{'indices': [50, 56], 'text': 'lca16'}],
  'symbols': [],
  'urls': [],
  'user_mentions': []},
 'favorite_count': 0,
 'favorited': False,
 'geo': None,
 'id': 690141371856982016,
 'id_str': '690141371856982016',
 'in_reply_to_screen_name': None,
 'in_reply_to_status_id': None,
 'in_reply_to_status_id_str': None,
 'in_reply_to_user_id': None,
 'in_reply_to_user_id_str': None,
 'is_quote_status': False,
 'lang': 'en',
 'place': None,
 'retweet_count': 0,
 'retweeted': False,
 'source': '<a href="http://wcmckee.com" rel="nofollow">wcmtwet</a>',
 'text': 'Hopefully this is sent to both slack and twitter. #lca16',
 'truncated': False,
 'user': {'contributors_enabled': False,
  'created_at': 'Sat Sep 20 08:09:39 +0000 2014',
  'default_profile': False,
  'default_profile_image': False,
  'description': 'Open Source Python Software/Web Development. AV volunteer at tech confs, and writer.',
  'entities': {'description': {'urls': []},
   'url': {'urls': [{'display_url': 'wcmckee.com',
      'expanded_url': 'http://wcmckee.com',
      'indices': [0, 23],
      'url': 'https://t.co/KQYI4xVTZd'}]}},
  'favourites_count': 3512,
  'follow_request_sent': False,
  'followers_count': 936,
  'following': False,
  'friends_count': 872,
  'geo_enabled': True,
  'has_extended_profile': True,
  'id': 2821347210,
  'id_str': '2821347210',
  'is_translation_enabled': False,
  'is_translator': False,
  'lang': 'en',
  'listed_count': 772,
  'location': 'Hamilton City, New Zealand',
  'name': 'wcmckee',
  'notifications': False,
  'profile_background_color': '000000',
  'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
  'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
  'profile_background_tile': False,
  'profile_banner_url': 'https://pbs.twimg.com/profile_banners/2821347210/1442397712',
  'profile_image_url': 'http://pbs.twimg.com/profile_images/621211385746161664/tGchJstD_normal.jpg',
  'profile_image_url_https': 'https://pbs.twimg.com/profile_images/621211385746161664/tGchJstD_normal.jpg',
  'profile_link_color': 'FFCC4D',
  'profile_sidebar_border_color': '000000',
  'profile_sidebar_fill_color': '000000',
  'profile_text_color': '000000',
  'profile_use_background_image': False,
  'protected': False,
  'screen_name': 'wcmckeedotcom',
  'statuses_count': 23260,
  'time_zone': 'Wellington',
  'url': 'https://t.co/KQYI4xVTZd',
  'utc_offset': 46800,
  'verified': False}}

Comments

Comments powered by Disqus