Slack Slash Command - inline image attachments - slack-api

I'm making a cribbage app for our slack channel. It's played using Slash commands. I'm currently showing the player their hand when they type the /showHand command, and it works, but I'd really like to be able to inline the image attachments but I cannot find a way to do this. Currently, it looks like this:
And if I use thumbnails it looks like this:
Is there a better approach? Possibly a way to add multiple images to one attachment? Possibly a display option to display response attachments inline?
UPDATE:
I followed Szymon Roziewski's advice and created a server-side module to download the card images I needed and create the final image of the player's hand. The images are cached so they only need to be downloaded once during the lifetime of the dyno.
I also contacted Slack support and I was told that inlining image attachments isn't currently possible but they might make it a future feature.

Related

Zapier: How to post tweets from trello multiple attachments of images?

I am using a zapier zap to post tweet from trello card added to a specific list.
The description part goes to tweet text and attachment image goes to image of tweet.
In case of one image attachment works well. I use zapier formatter to extract an image url from trello card's attachment.
But I want to tweet more than 1 images. In that case zapier pass the multiple attachments as one zipped file contains attached images. So it fails to pass it to the twitter as invalid media format because it is zipped format but not image format just like .jpg, or .png.
How can I implement this?
Thank you in advance.
What you're describing is expected behavior in how the hydration process is handled for multiple images.
You might be able to use a third-party service like - https://zapier.com/apps/convertapi/integrations app to get these files unzipped within the editor.
With that said, afaik, unless you're creating your own private dev Twitter app, the main app only able to accept one image per post at the moment.

Build QR code and display image without saving

I want to build QR Code of a particular string/url. After building, without saving I want to display the display the image. I don't want to persist the image. Something like http://example.com/qrcode?code=LOL,
should display the QR code for the string LOL.
Platform : Ruby on Rails 4
Thanks.
The best way is to do the process somewhere other than your server.
I'd suggest either using an out of the box API like: http://goqr.me/api/
Or even do it on the browser (if it's a web app) like: https://github.com/davidshimjs/qrcodejs
Disclaimer: I have not used any of these.
All the best :)

How does Snapchat show text over image

I am working on an iOS app where the users can add description/text when uploading images like Snapchat.
Do they render images and add the text to image so that it becomes part of the image itself or is it shown as a UILabel over the image?
For the 2nd option the text would have to be sent separately to server.
P.S. Just having an argument with Server side programmer and I'm suggesting the 2nd option.
If we check /ph/upload in Snapchat API (last updated 23-12-2013) we can see that you can upload either a photo or a video.
Of course, this is not the latest version (although this is the last documentation I could find) but I am assumming nothing has changed in that regard.
That means the text is inserted to the photo in the mobile client app, not on the server.
In my opinion, you shouldn't base any decisions about your API architecture on Snapchat because it's unlikely you have the same use cases. In general:
Sending data separately is more flexible and makes client implementation simpler.
Rendering data on the client is better for user experience (everything is faster and the user can see the final result) and also it saves a lot of server resources (the more users you have the more this will be visible).

Best way to display non-public images in a rails view

I am trying to find the best way to render confidential images in a view, without storing the images within the rails application flat-filesystem, as I have no idea where to place the images. I am storing the image data binary as :text in a sqlite3 database table and successfully display the images using
<% s = "data:image/png;base64,#{ActiveSupport::Base64.encode64(#my_image)}"%>
<img style = 'width:100%; height:600px' src = '<%= s %>'/>
This works for me in Firefox and Chrome, but my client cannot get the images to display. I'll find out in an hour or two what browser they are using. Client says they want the image src url to look like a relative path within a controller's folder, which seems to contradict the notion of not storing the image in the flat-file system.
I think I am missing something very small here, but I would like to know the proper way to store images and documents in an application that are not public to all users. If my question is not clear or you need information, please let me know and I will provide more information.
I have read of attachment_fu and paperclip, but they appear to allow attachment downloads, and I just need to display an image inline on a page. Any help is greatly appreciated. Thank you much in advance.
You can keep files in non-public repositories and have controllers action with send_file(path, options = {}) It allows you store files somewhere on the hard disc and keep access logic inside your controller.
Have you tried the paperclip gem? You can upload images to amazon and amazon allows you to set permissions for files...if you want to do it that way.
As Artem says, Amazon is a great way to achieve this. But if I get you right, they want to see an URL to the image directly (i.e. be able to type the source into the address-field if they want to).
You need to decide wether everyone should be able to access the image (given they know the name/path), or to have authentication, in which case I don't think a relative path is worth anything.
Can't you just have an image-folder containing all images (not accessible by URL), and a table to lookup wether userX is allowed to see imageY?

Issues with Filemaker IWP working with hyperlinks on images

I have a filemaker database that I need to be able to link records and all associated data (including container field data) to various points placed on a large PDF image, and then make that data appear via instant web publishing when someone clicks on the marker for that area on the PDF. For example the PDF may be an image of a car, and then I would have various close up images of issues with the car and descriptions of those images as records in the database. I would then want to drop points on the base PDF image and when you clicked on those points be able to see the close up images and other data related to those images.
I'm being told this is too much for IWP because:
I need to place the markers outside filemaker via PDF annotation
Filemaker IWP can't handle the number of markers that may be necessary (it could be up to 1,000 on an E sized image.
Does anyone have a work around or explanation why this is a problem?
If I understand correctly, you would like to setup a PDF with links that will open a browser and show data related to what was clicked. Assuming that is the case, the reason this wont work is because IWP does not provide a unique URL for a unique page. For example, here on StackOverflow you can directly link to any question based on its URL:
http://stackoverflow.com/questions/3207775/ -- this question
http://stackoverflow.com/questions/4973921/ -- some other question
IWP uses Javascript and session variables to manipulate the output to the screen, so there is no way to link to a specific section of your IWP site, since the URL is always something like:
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product A
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product B
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product C
Because of the limited nature of IWP, you will not be able to workaround this issue. You'll need to build your own web-interface using the Custom Web Publishing Engine, either using the built-in PHP extensions or some other technology where you invoke the XML publishing API.
I agree with Nate
IWP is the wrong solution to this problem. You'd be better off simply hosting those images on a webserver.
Now here comes the plug, you can use SuperContainer to really simplify the management of the images from FileMaker.

Resources