Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6610957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:54:27+00:00 2026-05-25T19:54:27+00:00

I have a Rails 3 app where I’m trying to display a page with

  • 0

I have a Rails 3 app where I’m trying to display a page with users and their respective Skype status. This is easy to do if the page is HTTP: just set a background url of an element to the image returned from http://mystatus.skype.com/mediumicon/USERNAME.

However, my site is HTTPS, and loading resources via HTTP from an HTTPS causes IE to choke. And Skype evidently doesn’t provide an HTTPS version of the status icon.

So I’m taking the approach of getting the Skype status server-side (i.e. in the controller) by calling the above URL with Net::HTTP. Then I can write JUST the image bytes back to the page without a problem using send_data(). But I can’t figure out how to stream the image bytes back to the view along with all the other page data.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:54:28+00:00Added an answer on May 25, 2026 at 7:54 pm

    Here is a code snippet that works. I have done it in sinatra purely to make it work stand alone, but the contents of the get block are the important lines.

    require 'sinatra'
    require 'net/http'
    require 'base64'
    
    get '/' do
      base_image = Net::HTTP.get(URI.parse('http://mystatus.skype.com/mediumicon/Gazler'))
      "<img src=\"data:image/png;base64,#{Base64.encode64(base_image)}\">"
    end
    

    This takes advantage of base64 encoding the source. You can read more here.

    Please note that this may not work on older versions of IE.

    One solution for this would be to base64 encode the image returned as above and to store all the images possible as a status and then do a comparison from the result. Obviously this would be quite slow doing it each time, so you would want to store the base64 of the images locally and then do a lookup on the base64 string.

    Hope this makes sense.

    EDIT

    As a helper method:

    def skype_status(username)
      base_image = Net::HTTP.get(URI.parse("http://mystatus.skype.com/mediumicon/#{username}"))
      content_tag("img", :src =>"data:image/png;base64,#{Base64.encode64(base_image)}")
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails app and trying to make a remote form, so far
I have a rails app with Devise 1.4.9. Currently, it allows only users from
I have rails app which has a list of users. I have different relations
I have a Rails app where users can upload images. After they upload an
I have a rails app which is already running with some users, users that
I have a Rails app that allows users to build up a network structure
I have a rails app and get this warning whenever I start the server
I have a Rails 2 app that serves multiple domains. That is, http://domainA.com and
I have a Rails app that uses STI to handle different types of Users,
I have a rails app with core features (layout, users, messaging etc) and 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.