How to share link of an video to my facebook account and twitter account..
-
hello friends
Actually i want to share the link of an video to my facebook account/twitter account by clicking on the button present in my mobile app..means suppose i have an live video in my app..now there is an buttons for both facbook and twitter..when i can click these button than the link of the video is shared to either of my account ...so hw this can be done..plz suggest
with regards
Anshuman -
Hi Anshuman,
There are plenty of articles about social networks in Forum Nokia. Some of them may help you:
http://wiki.forum.nokia.com/index.php/Facebook_Connect
http://wiki.forum.nokia.com/index.php/QML_OAuth
http://wiki.forum.nokia.com/index.php/KQOAuth_–_Easy_and_Powerful_OAuth_library_for_QtCheers,
Leon -
Edit: merged this message, that was posted as a separate thread, into this topic; Andre
hello friends,I am working on app where i have to post the video link to facebook,so i have used the postfeed project for facebook which is present in git repository,my link appears in the below way
http://xyz.abc.com.aspx?streamid=223322&id=1400...
now it accepts till http://xyz.abc.com.aspx?streamid=223322
and i can post the link till here,but as soon as i add the later part ie&id=1400,its not posting it,so what is the problem with that "&",please help me out..regards
anshuman -
Try to play with
"QUrl::toPercentEncoding() ":http://doc.qt.nokia.com/4.7/qurl.html#toPercentEncoding and "QUrl::fromPercentEncoding() ":http://doc.qt.nokia.com/4.7/qurl.html#fromPercentEncoding -
the code i have written is like this..u please check where i have done mistake..and where i use toPercentEncoding() function
@void Video::shareOnFacebook()
{PostFeed *pPostFeed=new PostFeed;
QUrl url;
url.setUrl("http://xyz.abc.com.aspx?");url.addQueryItem("streamid", video.url);
url.addQueryItem("id","1400");
url.addQueryItem("type","video-mp4");//mp4
url.addQueryItem("redirect","false");pPostFeed->setPostText(url.toString());
pPostFeed->showFullScreen();}@
-
can u please elobrate me..becoz here the url that i have to pass is in QString and in toPercentEncoding() its needs Qstring,Qbyte,Qbyte as arguments so can u give an example of how that can be done..i hv seen qt doc but i dont understand how to implement it in my code..please suggest me...
-
Did you read and understand my comment?
Do you mind writing correct english here, please. This is Qt Developer Network, not Facebook. I'm so tired of reading your g33ky l337 two-letter teenie writings. You and your well known colleague have been told so many times.
-
actually i tried this code..
@QUrl url;
url.setUrl("http://xyz.abc.com.aspx?");url.addQueryItem("streamid", video.url);
url.addQueryItem("&id","1400");
url.addQueryItem("&type","video-mp4");@
now link is share to facebook but only thing is that it only takes the link before "&" means if i pass
http://xyz.abc.com.aspx?streamid=643646&id=1900 then it share uptohttp://xyz.abc.com.aspx?streamid=643646..so hw can i resolve this..
-
Hi Borah,
this code:
@
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);QUrl url; url.setUrl("http://xyz.abc.com.aspx?"); url.addQueryItem("streamid", "643646"); url.addQueryItem("&id","1400"); url.addQueryItem("&type","video-mp4"); ui->m_pLabel->setText(url.toString());
}
@leads to this string in the label:
@
http://xyz.abc.com.aspx?streamid=643646&&id=1400&&type=video-mp4
@so it seams as the problem lies somewhere else...
As I see double & characters there, your parameters are perhaps wrong? -
hello Gerolf
Actually my work is to remove & from my url..intially when i write..url.addQueryItem("id", "3646"); then single "&" arises in the link..how can i replace "&"..i know it can encode it with % but how can i use it in code i dont understand..please suggest me..
with regards
Anshuman -
Sorry, I did not understand.
Please write you input string wand how it should look like as examples.
like:@
http://xyz.abc.com.aspx?streamid=643646&id=1400&type=video-mp4
@should become
@
http://xyz.abc.com.aspx?streamid=643646%id=1400%type=video-mp4
@ -
yeh..thats what i want..so how that can be done.can u please suggest me.
with regards
Anshuman Borah -
Use
@
QString sz = url.toString();
sz.replace(...);
@or look at the docu of QUrl:
- "void QUrl::setQueryDelimiters ( char valueDelimiter, char pairDelimiter )":http://doc.qt.nokia.com/4.7/qurl.html#setQueryDelimiters
-
hello Gerolf
Thanks for your suggestion..its working
with regards
Anshuman