After sending the following payload to MSTeamsBot:
{
"type":"messageBack",
"title":"Sotto Mare Oysteria & Seafood Rating: 4.5",
"displayText":"You chose Sotto Mare Oysteria & Seafood Rating: 4.5",
"text":"sotto-mare-oysteria-and-seafood-san-francisco",
"value":{
"property":"sotto-mare-oysteria-and-seafood-san-francisco"
}
}
The displayText is changed from
You chose Sotto Mare Oysteria & Seafood Rating: 4.5
to
Sotto Mare Oysteria & Seafood Rating: 4.5
Note that the & is being converted to &
How can I get the text to include the ampersand symbol instead of its escape sequence?
I just tested this on the iOS version of Microsoft Teams, and the button I used to deliver the displayText payload did not escape the special characters, including the &. The Windows desktop and web versions of Microsoft Teams, however, did.
This appears to be a per-platform environmental implementation for Microsoft Teams clients, with some escaping the ampersand, and others not.
Also, it seems the payload, from what I'm determining, does not have the escaped ampersand when the card was transmitted from bot to client (when I examined and decoded the card/button makeup, in my test implementation via the web browser version in Teams).
This has less to do with the Bot Framework itself, and more to do with the client being used to serve the Teams bot chat (be it Windows, in-browser, iOS, etc). I would recommend reaching out to MS Teams Support regarding this.
Related
I'm curious if it's possible for me to write programs that can control an Apple TV, specifically an Apple TV 4th gen running tvOS 9.1.1, like Apple's Remote app for iOS can. I'd like to send it commands for navigating in the four cardinal directions, selecting an item on the screen, going up the navigation stack -- essentially what Apple's Remote app can do.
Has anyone done any work reverse engineering the protocol it uses? Cursory Googling only has so far yielded out of date results about earlier generation Apple TVs and the DAAP protocol which looks like something different than what I want.
I captured the traffic on my iPhone using tcpdump and analyzed it with WireShark. The Remote app asks the Apple TV with normal HTTP requests on port 3689.
The workflow of the app consists in four HTTP requests:
/server-info for getting infos about the Apple TV. It responds with a Apple proprietary DAAP response (Digital Audio Access Protocol) providing some tags about the device, like the display name.
/login is performed during connection, when the app displays the "Connecting to Apple TV..." message. It responds with a DAAP about the login status.
Here's the bottleneck. /home-share-verify validates the connection between the app and the Apple TV. This call needs a Client-DAAP-Validation header with a long unknown string value. According to Wikipedia, this seems to be like an hash generated by a certificate exchange between verified sources that was introduced in iTunes 7.0+ and never reverse engineered.
/ctrl-int/1/{controlpromptupdate|controlpromptentry|playstatusupdate} seems to be the calls made for the input buttons.
Some other minor calls are fired in between (like a Bonjour service update or a /databases call).
Here and here you can find more infos. Hope this helps for getting an overview of how this simple (but protected) app works.
i wanted to tell alexa to trigger appletv and that would wake my appletv up and via HDMI & CEC turn my tv on,
in order to do that:
from your mac\linux\windows simply run:
curl -XPOST -d 'cmcc\x00\x00\x00\x01\x30cmbe\x00\x00\x00\x04menu' 'http://10.1.1.56:3689/ctrl-int/1/controlpromptentry?prompt-id=144&session-id=1'
the abstract command is:
curl -XPOST -d 'cmcc\x00\x00\x00\x01\x30cmbe\x00\x00\x00\x04menu' 'http://{APPLETV_IP}:3689/ctrl-int/1/controlpromptentry?prompt-id={CONTROL_PAIR_ID}&session-id={CONTROL_SESSION_ID}'
i extracted the CONTROL_PAIR_ID and CONTROL_SESSION_ID by setting my iphone wifi http proxy settings to my mac with fiddler on it and activated the old appletv remote app and that displayed the requests the app is executing
if you don't know how to set iphone to work with fiddler you can find it here:
http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForiOS
I did manage to control my Apple TV (currently running tvOS 9.2) from a python script. It turns out that you don't need to use Home Sharing to have a remote app control the Apple TV. I don't know if the following method will work if Home Sharing is enabled, but with it disabled on the Apple TV, the iOS Remote app has the option to manually add a device. (This may require removing all of the devices it is already paired with, since that was unfortunately necessary for me to get it to display the 'Add a device' button.) Once I had paired my iPhone to the Apple TV, I recorded some of its requests, copied the pairing GUID, and then constructed some of my own requests.
The only three requests necessary to make are:
/login?pairing-guid=< your pairing guid here >&hasFP=1
Logs into the Apple TV. The last four bytes of the response's is a session id, encoded as a big-endian four byte integer.
/logout?session-id=< your session id here >
Logs out. Not strictly necessary, as I found that logging in simply gets you a new session id, but probably not a bad idea to do things the way it expects.
/ctrl-int/1/controlpromptentry?prompt-id=114&session-id=< your session id here >
Send user input to the Apple TV. The data is one of several buffers that input a command, or possible a moving touch. For movement in the cardinal directions, sending several of these requests to simulate a moving touch is necessary.
I have a python script demonstrating how to do this here:
http://pastebin.com/mDHc353A
Utilizes the requests library: http://docs.python-requests.org/en/master/
Also special thanks to Adam Miskiewicz / github user skevy, since I made use of this file in his atlas-backend repo that conveniently had the right buffers to send for movement: https://github.com/skevy/atlas-backend/blob/master/atlas/services/appletv.coffee
For any people still checking out this question, I recommend checking out pyatv if they want to control their Apple TV through a python or command line interface.
I have developed an extension for Google Chrome, and I now localizing it to several languages. I have successfully localized it to many languages that use different alphabets (e.g. Russian, Hebrew, ...), but today I tried to upload to the web store a new version of the extension containing Hindi localization, and I got the following error:
An error occurred: Failed to process your item.
_locales/hi/messages.json:1:1: a object must begin with '{'.
The messages.json file for Hindi (hi) contains the following:
{
"appName": {
"message": "Mind the Word",
"description": "The title of the application, displayed in the web store."
},
"appDesc": {
"message": "इंटरनेट सर्फिंग करते समय भाषा सीखें|",
"description": "The description of the application, displayed in the web store."
}
}
I suspect it is an encoding issue. How can I solve this?
I had accidentally changed the encoding of the messages.json file to UTF-16. When I changed the encoding back to UTF-8, I was able to upload the new version of the extension to the web store.
Is this possible to get all items with their TAGS like
(Rarity,Quality,Hero,Slot,Type,Description)
for DOTA2(570), TF2(440), CS:GO(730), Steam(753)
I haven't found any api to get response with all items available for particular game.If anyone know how to get this please reply to my question.
There's no official API (e.g. the Web API) to get all information for all games. Web API only supports Dota 2 (IEconItem_570) and TF2 (IEconItems_440). There’s also an interface for CS:GO (IEconItem_730), but it's rudimentary and doesn't include weapon skins.
Because of that lack of official APIs Steam Condenser doesn't include a way to do this.
There's a way to mimic Steam's own web interface and mobile apps which use a JSON interface, e.g. http://steamcommunity.com/id/koraktor/inventory/json/730/2/ (where 730 is the app ID and 2 is the item type). Steam use other types than 2: 3, 6 and 7. The data structure is almost self-explanatory.
The language can be changed by setting the GET parameter l to the name of the language, e.g. english, german or french .
I tried Speech API example for Windows Phone 8. in my call phone 2 languages install en-GB and en-IN and my phone default language is en-in, when i tried with en-gb, it is working fine but when i tried with phone default language which is en-in, it is not working
it gives error , it throws exception.
On this code:
Perform speech recognition.
this.recoOperation = recognizer.RecognizeAsync();
var recoResult = await this.recoOperation;
It throws Exception:
**SPERR_WINRT_UNSUPPORTED_LANG 0x800455BC The requested language is not supported.**
So, It is means what Indian English is not supported with Speech Recognitiona API or I should change some additional settings to make it work?
Thanks.
As the documentation on Dev Center, this error code means “The requested language is not supported.” And this will happen on a new phone (or sometimes after you reset the phone) when the speech is activated, a language is chosen, but the language pack is not actually downloaded and installed on the phone. The user will have to go to phone settings to choose another speech language and then switch back again to see the message prompt for installing the language pack.
Bing speech require english(us) language(or other supported language) to be enabled in your phone's language settings. After that you get a prompt to restart, which will make it work
I'm trying to create a FTP Client in AS3.
It works well with almost all my ftp hosts, but I'm not able to login in hosts in wich I have an "#" (at commercial) character inside the username.
It seems a character encoding error.
I'm sending the string in this way:
ftp_username = "aaaaa#bbbbb.ccc"
s.writeUTFBytes("USER " + ftp_username + "\n");
but I'd never got a 331 response (Username Accepted) from the FTP server.
ps: i tried replacing '#' char with '%40' or '+' without success.
At the end of Section 4.1 of the RFC 959, which deals with the FTP protocol standards, it defers to the Telnet protocol and the Telnet eol code.
To quote from the RFC:
The File Transfer Protocol follows the specifications of the Telnet protocol for all communications over the control connection. Since the language used for Telnet communication may be a negotiated option, all references in the next two sections will be to the "Telnet language" and the corresponding "Telnet end-of-line code". Currently, one may take these to mean NVT-ASCII and <CRLF>. No other specifications of the Telnet protocol will be cited.
Then again in RFC 1123, Section 3.3.1 references the correct end-of-line as <CRLF>:
The Telnet protocol defines the sequence CR LF to mean "end- of-line". For terminal input, this corresponds to a command- completion or "end-of-line" key being pressed on a user terminal; on an ASCII terminal, this is the CR key, but it may also be labelled "Return" or "Enter".
Then it goes into a discussion about the ambiguity of line endings on different platforms. And says that allowances should be made for <CR NUL>, or \r\0, but again says that <CRLF> should be the default.
On the Wikipedia article for Newlines, also discuses the issue, and says:
Most textual Internet protocols (including HTTP, SMTP, FTP, IRC and many others) mandate the use of ASCII CR+LF (0x0D 0x0A) on the protocol level, but recommend that tolerant applications recognize lone LF as well. In practice, there are many applications that erroneously use the C newline character '\n' instead (see section Newline in programming languages below). This leads to problems when trying to communicate with systems adhering to a stricter interpretation of the standards; one such system is the qmail MTA that actively refuses to accept messages from systems that send bare LF instead of the required CR+LF.
So stick with \r\n and you'll be fine...