Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to share link of an video to my facebook account and twitter account..

How to share link of an video to my facebook account and twitter account..

Scheduled Pinned Locked Moved General and Desktop
16 Posts 4 Posters 7.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leon.anavi
    wrote on last edited by
    #2

    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_Qt

    Cheers,
    Leon

    http://anavi.org/

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BorahAnshuman
      wrote on last edited by
      #3

      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

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #4

        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

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • B Offline
          B Offline
          BorahAnshuman
          wrote on last edited by
          #5

          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();

          }@

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #6

            Any links to that postfeed project?

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • B Offline
              B Offline
              BorahAnshuman
              wrote on last edited by
              #7

              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...

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #8

                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.

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  BorahAnshuman
                  wrote on last edited by
                  #9

                  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 upto

                  http://xyz.abc.com.aspx?streamid=643646..so hw can i resolve this..

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    giesbert
                    wrote on last edited by
                    #10

                    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?

                    Nokia Certified Qt Specialist.
                    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      BorahAnshuman
                      wrote on last edited by
                      #11

                      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

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        giesbert
                        wrote on last edited by
                        #12

                        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
                        @

                        Nokia Certified Qt Specialist.
                        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                        1 Reply Last reply
                        0
                        • B Offline
                          B Offline
                          BorahAnshuman
                          wrote on last edited by
                          #13

                          yeh..thats what i want..so how that can be done.can u please suggest me.

                          with regards
                          Anshuman Borah

                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            giesbert
                            wrote on last edited by
                            #14

                            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

                            Nokia Certified Qt Specialist.
                            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              goetz
                              wrote on last edited by
                              #15

                              Borah,

                              why so complicated? Is it so hard for you to just write:

                              This is what I have: abcdef
                              This is what I want: xyzklm

                              Nobody understands your explanations - do you?

                              http://www.catb.org/~esr/faqs/smart-questions.html

                              1 Reply Last reply
                              0
                              • B Offline
                                B Offline
                                BorahAnshuman
                                wrote on last edited by
                                #16

                                hello Gerolf

                                Thanks for your suggestion..its working

                                with regards
                                Anshuman

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved