how to share link of an video to my facebook account/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
Re: how to share link of an video to my facebook account/twitter account
1. you need to have a server that relay your post to facebook twitter. (need all authentication etc on your server)
2. you need to have both twitter and facebook libraries in your application.
Re: how to share link of an video to my facebook account/twitter account
yeh that i have..i have done all that things..when i click these button it went to the login page of facebook/twitter..as applicable..after that when i sign in..than i give a text box to share some views..its all work but the thing is that the link to the video is not come in that text box..so hw that can be done..
Re: how to share link of an video to my facebook account/twitter account
[QUOTE=AnshumanBorah;837503]yeh that i have..i have done all that things..when i click these button it went to the login page of facebook/twitter..as applicable..after that when i sign in..than i give a text box to share some views..its all work but the thing is that the link to the video is not come in that text box..so hw that can be done..[/QUOTE] have you uploaded the video file some where online ?
Re: how to share link of an video to my facebook account/twitter account
ok i will send u the twitter code...
[QUOTE]#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QWebView>
#include <QTextEdit>
#include <QWebFrame>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::SslErrors(QNetworkReply * reply, const QList<QSslError> & errors) {
reply->ignoreSslErrors(errors);
}
void MainWindow::on_pushButton_clicked()
{
QWebView *web=new QWebView(this);
web->resize(this->width(),this->height());
QObject::connect(web->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*,const QList<QSslError>&)), this, SLOT(SslErrors(QNetworkReply*,const QList<QSslError>&)));
web->setUrl(QUrl(QString("http://mobile.twitter.com/?status=")+ui->textEdit->toPlainText())); // [B]so i want the link to be display in that textEdit box[/B]
web->showMaximized();
}
[/QUOTE]
Re: how to share link of an video to my facebook account/twitter account
yes but the link you have to get it your self by uploading it to some video hosting provider.
Re: how to share link of an video to my facebook account/twitter account
how that can be done..that thing i dont know can u plz suggest me for that..
Re: how to share link of an video to my facebook account/twitter account
have you read these facebook graph doc ?
[url]http://developers.facebook.com/docs/authentication/[/url]
[url]http://developers.facebook.com/docs/reference/api/link/[/url]
Then you have to use QWebView to authenticate and get the access token ... by adding offline_access permission as param you get a long life token, that means onetime only login.
Be aware you have to setup a facebook app ,see [url]http://www.facebook.com/developers/[/url]
After that you can use QNetwork api to make http post that includes link and that token in the request
Re: how to share link of an video to my facebook account/twitter account
Hello skumar
Yesterday i ask you a question about..." How to share link of an video to my facebook / twitter account "...i have tried a lot but cant do it..actually my problem is simple...what i want is that i have an online video running in my app..there is an facebookbutton,twitter button...when i press any of the button than i went to a new dialog where there is an textEdit box and loginbutton..when i press the login button the login page is opened.form that process is goes on...all things work...but the thing i want is that in the textEdit box i want the link of the video to be displayed....
my all things are workin ie on click of any of the twitter button and facebook button the new dialog open..from there i went to the login page..but the thing thats nt workin is the display of video link in the textedit box...
so please suggest me....
code for twitter i hv send u.....
with regards
Anshuman
Re: how to share link of an video to my facebook account/twitter account
[QUOTE=AnshumanBorah;837715]...but the thing thats nt workin is the display of video link in the textedit box...[/QUOTE]
Why would that be a problem? It is a simple as calling textEditor->setHtml("This is ... blah ... blah <a href="http://put_link_here">a video link</a>");
Re: how to share link of an video to my facebook account/twitter account
thanks itomuta..now i want to know whether that link change dynamically for each different video..or it is fixed for a paticular video only...if not how cani made it dynamic...thats means depending on the video its change the link dynamically..
with regards
Anshuman
Re: how to share link of an video to my facebook account/twitter account
hello skumar
As far of my question i had ask u abt "sharing link of an video to my facebook / twitter account " i hv used the code
textEditor->setHtml(" <a href="http://">a video link</a>");// given by itomuta.
but i dont understand what i have to write inside "http://" and inside "a video link"
Re: how to share link of an video to my facebook account/twitter account
[QUOTE=AnshumanBorah;837942]hello skumar
As far of my question i had ask u abt "sharing link of an video to my facebook / twitter account " i hv used the code
textEditor->setHtml(" <a href="http://">a video link</a>");// given by itomuta.
but i dont understand what i have to write inside "http://" and inside "a video link"[/QUOTE] "a video link" is the url that link where you have uploaded the video file.
Re: how to share link of an video to my facebook account/twitter account
now in my app there r lot of online video running..now how can i pass the url of each video dynamically on clicked of pushButton..i mean to say suppose there is a one video running when i click the push button the url of that video is set in the textedit box..again when the video change..then hw the url change...for that ehat i have to do..i hv sent u the code..u just check it
[QUOTE]void MainWindow::on_pushButton_clicked()
{
QWebView *web=new QWebView(this);
web->resize(this->width(),this->height());
QObject::connect(web->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*,const QList<QSslError>&)), this, SLOT(SslErrors(QNetworkReply*,const QList<QSslError>&)));
[B] ui->textEdit->setHtml("");[/B] //what i have to write here..
web->setUrl(QUrl(QString("http://mobile.twitter.com/?status=")+ui->textEdit->toPlainText()));
web->showMaximized();
}
[/QUOTE]
Re: how to share link of an video to my facebook account/twitter account
Anshuman, is this the first program you're writing? There is a forum for begginers where I can move this, and there could be some books that we could recommend as well.
Other than that, maybe you should slow down and start thinking ...
You know the URL of the currently played video, otherwise you won't be able to play it. So when the button is pressed, you have to take that URL from whichever object or data structure holds it, and add it to your message.