This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Delivered-To: sorinemail@gmail.com | |
Received: by 2002:aa7:c81a:0:0:0:0:0 with SMTP id a26csp34672edt; | |
Mon, 8 Jun 2020 14:02:18 -0700 (PDT) | |
X-Google-Smtp-Source: ABdhPJxv9W1dxD/THRt7P/LqyHPP2NiD/OJt11J+MaDqLR3DsyxmqVEg5iob7tBgntvkVcbtrZu1 | |
X-Received: by 2002:a05:6830:617:: with SMTP id w23mr19606783oti.0.1591650138114; | |
Mon, 08 Jun 2020 14:02:18 -0700 (PDT) | |
ARC-Seal: i=1; a=rsa-sha256; t=1591650138; cv=none; | |
d=google.com; s=arc-20160816; | |
b=b585xVKfxihgXm0zKr0SLsBYwqe/rhxOcyNvVZdoYIWyXwuAkDuvPol7Mm4Z+/8ZU8 | |
vCu+Hi/m1NM1Fqp9JO7wO8dC3Kaa6twiG/88RpvA4ik1FUrgAehVYLXZ6mkP+pl3eq9O |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'json' | |
post '/conversation' do | |
payload_body = request.body.read | |
puts "payload_body >> #{payload_body.inspect}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intercom.conversations.reply(id: conversation_id, type: 'admin', admin_id: admin_id, message_type: type, body: message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payload = JSON.parse(payload_body) | |
user_id = payload["data"]["item"]["user"]["user_id"] | |
intercom = Intercom::Client.new(token: <ACCESS_TOKEN>) | |
intercom.conversations.find_all(user_id: user_id, type: 'user') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conversations.first(5).each do |convo| | |
if (convo.updated_at > time_threshold) | |
convos_updated.push({:id => convo.id, :updated_at => convo.updated_at}) | |
else | |
# If the current checked conversation is not updated in the time threshold, we're not checking the next one | |
break | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if updated_convos.count.between?(1, 4) | |
message += " 😎 <b>Vigilante</b> - Possible duplicate conversation! <br>" | |
message += "<br>This user has <b>#{updated_convos.count} other conversations</b> updated in the last #{HOURS} hours:" | |
updated_convos.each do |convo| | |
message += "<br> <a href='https://app.intercom.com/a/apps/#{APP_ID}/respond/inbox/conversation/#{convo[:id]}'>#{convo[:id]}</a> - #{convo[:updated_at]}" | |
end | |
elsif updated_convos.count > 4 | |
message += " 😎 <b>Vigilante</b> - Possible duplicate conversation! <br>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get UTM Params | |
var querystring = document.location.search; // Get the string after the domain | |
querystring = querystring.substring(1); // Remove the leading "?" | |
querystring = querystring.split('&'); // Split the string in utm variables | |
var utms = {}; | |
for (var i = 0; i < querystring.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo gem install sass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install ruby-build | |
brew install ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo brew update |
NewerOlder