#include "esp_camera.h"
#include <UniversalTelegramBot.h>
How to Convert from:
fb = esp_camera_fb_get();
by something accepted by Telegram
e.g.
String sent = bot.sendPhoto(chat_id, ....
or
String sent = bot.sendPhotoByBinary(chat_id, ....
You can try to save the image to SD card and then send photo using the bot api.
See more:
save to sd card,
send photo.
Related
How can I bind my YouTube stream key to match previous video.
I'm trying to use java to do it but getting no where.
I'm looking at the example given to create the broadcast stream but it doesn't have the keeping same key.
I've gotten help on this before. Please try do some research on Google and then ask the question. You can see How can I change the stream my event uses via the YouTube live api?. Which will help you as it did me.
In short this was the code i received for help.
Credit to #M. Prokhorov
YouTube yt = ... // your reference to YouTube
String broadcastId = ... // your broadcast Id
String newStreamId = ... // identifier of stream you want to bind
String apiKEy = ... // your API key
// you can define other response parts if you want more or don't want some of these
String responseParts = "id,status,contentDetails.boundStreamId";
yt.liveBroadcasts().bind(broadcastId, responseParts)
.setApiKey(apiKey)
.setStreamId(streamId)
// other data you might want in request
.execute()
I am following this below library for my applications where user have to chat with other user.
SocketChat
There I can chat with other users. Now my prime concern is to send images to server and then that image is going to reflect in the chat of the other user's window. Its like Group chat.
I am done with image sending from iOS app
I don't know what to write to handle byte array which is of the image I sent from one of the client.
clientSocket.on('images', function(clientNickname, message){
var currentDateTime = new Date().toLocaleString();
var dataType = "imageType"
delete typingUsers[clientNickname];
io.emit("userTypingUpdate", typingUsers);
io.emit('newChatMessage', clientNickname, message, currentDateTime,dataType);
});
I think its not working. Its good for the string type data. Can you please let me know what to write there in order to receive image and send that back.
I'm developing iOS app using "UniPay, Mobile Audio Jack MagStripe and Smart Card Reader"
to read smart credit card data.
I got the card data but it is not plain text, the SDK does not show how to parse the data. I have set the encryption mode to unencrypted mode. I guess the data is encoded in some kind of format. I have used the same decoding I use to parse magnetic stripe data but it did not work. does anyone know what kind of encoding is used or if the is kind of encrypted regards the flag i set. The following code is the example provided from SDK, I need to parse the rt.data to get credit card information such as card Number.
RDResult rt =[reader smart_ICC_PowerOn]; if (rt.status != RDS_SUCCESS) {
NSLog(#"ICC Powerd On - Failed.");
return; }
Else
{
NSLog(#"ICC Powered On: %#", rt.data.description); }
Thanks in advance,
We have implemented an iphone app which uses the facebook chat, partly over xmpp and partly over the facebook graph api.
Everything is fine, until it comes to emoticons. When we enter the emoticon on the iPhone, we get the correct emoticon on our display.
But the message, we get from facebook is some other escape sequence as we sendt to facebook via xmpp.
Heres an example:
We send the following xml via xmpp:
<message type="chat" to="-someFacebookID#chat.facebook.com"><body>😷</body></message>
When we recall that message from facebook we get the follwing:
{
"author_id" = someID;
body = "\Uf637";
"created_time" = 1351607849;
"message_id" = "someID_41";
"thread_id" = someID;
}
Here is our FQL-Statement for the messages:
#"SELECT message_id, author_id, thread_id, created_time, body FROM message WHERE thread_id = %#"
But why does facebook convert the emoticon, which displays correctly in the facebook-chat on the website?
Any ideas on this problem?
Regards,
Daniel
The returned text (such as "\Uf637" in your sample) is the unicode representation of the emoticon. Facebook's database does not store emoticons in their full form, they are converted to unicode, and are converted back to their emoticon form when displayed on Facebook's apps. You'll probably have to do the same thing in your own app when using the Chat API (for all unicode emoticon-like strings found, convert it to the actual emoticon). Here is a full list of unicode codes with their matching emoticon symbols: http://www.unicode.org/charts/PDF/U1F600.pdf
I am building an application where I need the option to share via email and SMS.
I have done the share via Email, where when the user selects the image, the url is passed as the content of the email. But while sharing via SMS, I can't do something like setContent as I did for email and fetch the url in the SMS directly, instead of user typing the address manually.
I am using Message class in email and MessageConnection class for SMS, as shown in the blackberry community example.
The Message object you receive when calling MessageConnection.newMessage(TEXT_MESSAGE) is actually a TextMessage object (or a BinaryMessage object with BINARY_MESSAGE).
If you cast the received object to the proper class (TextMessage or BinaryMessage), you should be able to use its setPayloadText(String data) (or setPayloadData(byte[] data) for a BinaryMessage) to enter a value in the message before sending it.
Your code should look like this:
Message msg = myMessageConnection.newMessage(TEXT_MESSAGE, /* address */);
TextMessage txtMsg = (TextMessage)msg;
txtMsg.setPayloadText(/* Text to send */);
myMessageConnection.send(msg);
When you send an email, you can set the body of it and send it to the user from the Email native application. You cant do taht for SMSs. I worked on that issue and for BB Torch I was able to set the text of the SMS message but for other devices that was impossible. I always obtain an empty text message!!
So y suggestion to you is using the following code wich will send the SMS to a number without the interference of the user
MessageConnection conn = (MessageConnection) Connector.open("sms://" + userNumber);
TextMessage txtmessage = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
txtmessage.setPayloadText(text);
conn.send(txtmessage);