Use mention in dialog Slack - slack-api

I have developed a slack bot which purpose is to give details about the company's projects.
I tried to use slack dialog to ask for different information such as the name, a description and the people involved in the project.
To do the last part (people involved), I wanted to use mention (#), so that the person who adds the project doesn't have to know the exact name / email of each participants. I'm pretty sure it's not possible but before trying another solution, I wanted to ask since I didn't find anything on internet.
Can we or can we not use mentions in slack dialog ? And if we can, how ?

No, the Slack Dialog currently does not have support for multiple mentions. The text elements will has support for url, email, number and telephone number. But not for mentions.
However, mentions work nicely with slash commands. You can add a list of users after your slash command with a mention and their will be automatically detected and matched to list of Slack user.
So maybe its possible for you to start with a slash command including mentions and use the Dialog to request additional information.

Related

How to add "Order Online" link on GMB using the API

[NOTE: This may be not the right place for this question. Can you please refer me to the right place if this is not.]
I know you can login to GMB, verify the business and than add the "Order Online" link from the GMB console.
We are an agency and expanding fast so we are trying to find out a way of adding our link to all our customer's GMB pages without needing to getting verified for each of them separately but rather using the API if possible.
Anyone here has experience doing this? I looked through the API, but can not find anything like this.
It is not possible to influence this attribute. See this article
In some cases, links to certain third-party booking services will appear automatically on business listings. These links cannot be edited in Google My Business.
If you want to remove or fix a link in your own listing, please contact the third-party provider’s support team or a technical contact to request they remove your data from the information they are sending Google.

Custom user tracking or 3rd party service for page referral analytics

The question I'm trying to answer for a set of users is how other users end up on their page. There are about 5 different ways a user can end up on your page. For example, they could have searched your name, clicked a link from a newsfeed or received an e-mail with a link to your page.
What is the best way to accomplish tracking these events? I'm initially inclined to create a table to track this. Each link would send an async event to the server to be added to the table. However, I'm also aware that there are many tracking services out there such as Google Analytics and Mixpanel. I've looked at their docs briefly and they don't seem to fit my need.
Am I missing something? Is it worth it to create a "custom" even tracking system to accomplish this?
It is not worth creating your own service. Plus you cannot add async link to search engine result pages or emails (that would require tracking code that you cannot implement in search engines or that would not be executed in mail clients).
Web analytics software tracks traffic sources by analyzing the incoming traffic via its http headers. If there is a referrer set the traffic will be attributed to, well, the referring site, unless the traffic is included in a list of known search engines in which case it will be attributed to organic search traffic etc.
In most systems you can customize source attribution by adding query parameters in the url (obviously this will not work with search engines and the like, since you cannot add parameters to organic search results). For example with Google Analytics you can add custom campaign parameters in email links or advertising campaigns. If people click on those links the parameter value will be send to GA and the source/medium/campaign information will be set accordingly (e.g. traffic from web mail clients would usually be attributed as a referrer, but campaign parameters allow to attribute the link to your mail campaigns).
There might be reasons to create your own system, but channel attribution is not one of them; GA and every other system I know of has this thoroughly covered.

Google+ Authorship: #REL, GET Parameters and Redirects

I recently decided to start to take advantage of rich snippets to improve my personal website's content for the search engines and, IMHO most importantly, the site readers – hi, Mam! ;-). One of these are Google Authorship. Personally, I think the idea behind Google Authorship is a sound one: it helps to brings a sense of identity, personality and – arguably, most importantly – credibility to what is still largely an anonymous web.
Normally, I would link my article to Google Authorship using the following line of HTML:
<A REL="author" HREF="https://plus.google.com/112431363835029530079?rel=author">Jordan Clark</A>
However, in the instance of a website that publishes articles that are written by multiple authors, manually entering each another’s Google+ UID string starts to become a tiresome process.
Is is valid to do the following:
(a) Link to the author like so, using the script "author.php" (or other type of server-side script).
<A REL="author" HREF="/author.php?by=Alice&rel=author/[UID]?rel=author">Alice</A>
(b) The file "author.php" scripts simply do a quick check for Alice's (or whoever) User ID string provided by Google, and then uses a simple HTTP redirect header to pass this data to Google.
What I would like to know is:
Is it okay to use a local script to redirect to your Google+ user profile? (i.e. will it affect the PageRank of already indexed page or have any other unforeseen negative effects on new and indexed pages?)
Why do I not see more people linking with Google’s “prettified” version:
http://profiles.google.com/clarky.y2k?rel=author
Are there any drawbacks to using the “prettified” version of this method?
Ideally, I would like to use the intermediate PHP script, as I have already described above (see part 1). However, any tips, suggestions or other ways you may have implemented on your websites are very welcome!
For item (1), you can maintain your own app's profiles (author.php in your case) for your authors. On your own app's profile page (author.php), you would add a link from that page to Google and specify the rel="me" attribute on that link. So Alice's profile page might say something like "Find Alice on Google+.
This indirect authorship linking is supported. You also will need the link from Alice's Google+ profile that lists her as a contributor to your site. Once the linking is setup in both directions, authorship can start to show up. Authorship won't always display in all cases and can take some time for it to start appearing as Google would need to reindex your pages.
For item (2), I don't think the profiles URL will enable authorship. Some people use that URL as a vanity URL, but as far as I know it isn't supported for use with things like authorship, badges, etc.
You should test if your redirects are followed using the Rich Snippets Testing Tool: http://www.google.com/webmasters/tools/richsnippets
rel="author" is no longer supported.

Using OAuth to retrieve "consumer" email from a linked Google Apps Script within a Google Apps Site

While https://developers.google.com/accounts/docs/OAuth2Login is very descriptive, I cannot seem to wrap my head around how to translate into a Google Apps Script.
The ultimate goal is to have the user click a link, authorize access to their userinfo. I will then use their email address or userId to assign the appropriate spreadsheet to other Google Apps Scripts UIs.
I am certain that some sample code would get me on my way.
Is it even possible?
Can a linked be utilized to make this happen? http://support.google.com/sites/bin/answer.py?hl=en&answer=1224166&topic=1224152&ctx=topic
The trouble is that when you publish your script as a service, it executes under your ID. All the authorization has to be done in the script editor. So, when a third person clicks a button or link or whatever, the script runs under your user ID and all you get back is your own user id.
In short, the answer is no. Sad, but true :(
Check out the OAuth code on the Google Code site. There are some great examples along with the client (and server) code in several different programming languages. Follow along with the samples on how to get the tokens needed.

Twitter API: how to know what application was used to follow

In the email notification we can see something like
<username> followed you using <appname>.
It is great. But is there any possible way to know the application name using API?
I took a look through the REST API, and I could not find anything that would support this. My guess is that this is a twitter.com feature that is available in the API (yet).
The most logical places I looked were statuses/followers and friendships/show. In both cases there was nothing definitive. Checking the follower emails for my account, I found multiple followers that used applications (like PeopleBrowr and SocialOomph) to follow the account. In most cases, the source on their latest status object matched the application name used to follow me, but that was definitely not a sure thing.
So, to answer your question directly, no I don't think it can be done through the API (not unless there's an undocumented method out there that does this.)
I can, however, think of a way to get that info. One approach would be to set up the email account receiving the follow notifications to forward a copy to a mailbox that is checked by an automated process. When emails show up, parse them to find the app name used to follow you.
I used the following regular expression (in C#) to find the application's name and URI in the email's body:
Match m = Regex.Match(input, #"followed you using\s*<a[^""]+""(?<appUri>[^""]+)""[^>]+>(?<appName>\w*)</a>");
I used m.Groups["appName"].Value to pull out the application name, and m.Groups["appUri"].Value to pull out the URI from the match.
In order to tie the app info to a user, I had to also find the screen name with:
Match m = Regex.Match(user, #"\(#<a[^>]+>(?<screenName>\w*)</a>\) is now following");
I used m.Groups["screenName"].Value to extract the value from the match.

Resources