更改MSN聊天状态图标

发布于 2024-10-17 20:49:39 字数 258 浏览 1 评论 0原文

我正在使用此技巧将 MSN Messenger 集成到我的网站:http://en.kioskea.net/faq/3987-integrate-msn-chat-on-your-website-or-blog 它显示一个带有当前 MSN 状态(在线、离开等)的图标。我想改变这些图像。是否可以?

I'm using this tip to integrate MSN Messenger to my Website: http://en.kioskea.net/faq/3987-integrate-msn-chat-on-your-website-or-blog
It shows an icon with the current MSN status (online, away and so on). I want to change these images. Is it possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海夜未眠 2024-10-24 20:49:39

我第一次回答这个问题时遇到了麻烦:

转到这里:

http://messenger.services.live.com/users/[电子邮件受保护]/presence图像?mkt=en -GB

会将您重定向到:

http://www.wlmessenger。 net/static/img/presence/Offline.gif

这使得检测状态变得更加容易!

我错过了。


我在这里查看:

http://settings.messenger.live.com/Applications/CreateHtml.aspx

我选择了“状态图标”选项,并得到了如下代码:

<a target="_blank" href="http://settings.messenger.live.com/Conversation/[email protected]&mkt=en-GB">
    <img style="border-style: none;"
     src="http://messenger.services.live.com/users/[email protected]/presenceimage?mkt=en-GB"
     width="16" height="16" />
</a>

无论您的状态如何,图像的路径都保持不变。

无法根据其更改图像状态通过纯 HTML/CSS/JS 在图像中返回(据我所知)。 (即使在我意识到它重定向之后)

我可以想到一种技术来做到这一点,但这并不容易并且不太难,但是您必须使用服务器端语言,例如 PHP 或 ASP.NET。

您可以将该代码更改为如下所示:

<a target="_blank" href="http://settings.messenger.live.com/Conversation/[email protected]&mkt=en-GB">
    <img style="border-style: none;" 
     src="proxyMyMsnImage.php"
     width="16" height="16" />
</a>

proxyMyMsnImage.php 将执行以下操作:

  • 执行 HEAD 请求(或 GET,如果是这样)不起作用)在图像上(http://messenger.services.live.com/users/[email protected]/presenceimage?mkt=en-GB)
  • 取决于您重定向到的图像(例如 Offline.gif) ,您可以发送您自己的状态图像版本以及正确的 MIME 类型,例如 image/gif
  • 您可以缓存此结果,并且仅在至少经过 X 时间(例如 2 分钟)时才更新它。

弄清楚如何检测您发送的状态图像是最困难的部分现在非常简单。

I made a snafu answering this the first time:

Going here:

http://messenger.services.live.com/users/[email protected]/presenceimage?mkt=en-GB

will redirect you to:

http://www.wlmessenger.net/static/img/presence/Offline.gif

which makes detecting the status a whole lot easier!

I missed that.


I looked here:

http://settings.messenger.live.com/Applications/CreateHtml.aspx

I picked the Status Icon option, and was given code like this:

<a target="_blank" href="http://settings.messenger.live.com/Conversation/[email protected]&mkt=en-GB">
    <img style="border-style: none;"
     src="http://messenger.services.live.com/users/[email protected]/presenceimage?mkt=en-GB"
     width="16" height="16" />
</a>

The path to the image remains the same no matter what your status.

There is no way to change the image based on which status is returned in the image with pure HTML/CSS/JS (afaik). (even after I realised it redirects)

I can think of a technique to do it, but it's not easy and it's not too hard, but you'll have to use a server side language such as PHP or ASP.NET.

You would change that code to something like this:

<a target="_blank" href="http://settings.messenger.live.com/Conversation/[email protected]&mkt=en-GB">
    <img style="border-style: none;" 
     src="proxyMyMsnImage.php"
     width="16" height="16" />
</a>

proxyMyMsnImage.php would do the following things:

  • Does a HEAD request (or GET, if that doesn't work) on the image (http://messenger.services.live.com/users/[email protected]/presenceimage?mkt=en-GB)
  • Depending on which image you're redirected to (for example Offline.gif), you send your own version of that status image, along with the correct mime type, for example image/gif.
  • You could cache the results of this, and only update it if at least X time has passed (say, 2 minutes).

Figuring out how to detect which status image you were sent is the most difficult part now really easy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文