Results 1 to 24 of 24

Thread: newstwitter

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    417

    Default newstwitter

    I am running Contao 2.9.1

    I have installed newstwitter.

    When I attempt to tweet a news news item nothing happens. Looking in the logfile I can see an error message "Error posting to Twitter" and "Funtion: NewsTwitter twitter()"

    I have treble checked that my username and password are correct, any ideas what else could be the problem?

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: newstwitter

    Just use the tweet button code and paste it into your newsreader template
    http://twitter.com/goodies/tweetbutton

    My website uses the tweet button AND the built-in twitter link for articles...

    EDIT: no worries. I see now

  3. #3
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    Thanks John, yep a bit of lateral thinking certainly helps.

    I did have the tweet button already, just didn't think to use it ops:

    http://www.cottam.co.uk/blog-posts/item ... -2020.html

    Please forgive the design, just working on the functionality to start with

    I would like to be able to use the newstwitter extension. Would be handy to complete all from the one interface, and the send now/schedule option would also be handy.

    Maybe Andreas (as the extension author) will come across this, and be able to help/point me in the right direction

    Luv your new site by the way!

  4. #4
    jeanlerye
    Gast

    Default Re: newstwitter

    I have just installed the news twitter few weeks ago. It also doesn’t work well, some problem regarding this exists but it's not that complicated though. Alternatively, the tweet button may help on making clear news twitter.

  5. #5
    User
    Join Date
    09-25-09.
    Location
    Amsterdam, The Netherlands
    Posts
    103

    Default Re: newstwitter

    I have exactly the same (2.9.1 as well)

    I entered the the consumer key and secret, which I checked twice. Also, I get the error Authentication failed.

    Is there already a solution? What is meant with the tweet button?

  6. #6
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    Yep, would be good if this extension worked.

    In edit article, there is a section "Syndication", if you check "Share on Twitter", it will display Twitter icon on the page.

    See here for an example:

    http://www.cottam.co.uk/blog-posts/item ... -pope.html

  7. #7
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    Hi,

    News Twitter extension was a handy tool, but it stop working since 30th Aug 2010: my forum's article
    although deadline was postponed from 16th Aug to 30th Aug.

    Because it uses Basic Authentication to accessing Twitter, but Twitter stop supporting it and
    expects to use OAuth. So, someone implement posting OAuth, it shouldn't work...
    --
    Takahiro Kambe

  8. #8
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    Hi.

    I've missed the release of News Twitter 1.2.0 stable and my previous post slightly missed the point.
    (Extension Manager didn't suggest newer version, maybe my Contao is 2.9.1 and previous release of
    News Twitter 1.1.0 support up to Contao 2.9.0.)

    And I successfully tweet by News Twitter 1.2.0. One important point was "Application Type" and "callback URL" in Twitter's application configuration.

    • "Application Type" should be "Browser".[/*:m:33589oce]
    • "Callback URL" must be filled.[/*:m:33589oce]


    "Callback URL" isn't really used but if it is left to blank, Twitter's authentication would be fail.

    Best regards.
    --
    Takahiro Kambe

  9. #9
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    Thanks for your help with this.

    Yep, my extension manager did not pick up that there was a new release

    The extension says "You are authenticated. Click here to use different credentials."

    But, the log file still says "Error posting to Twitter".

    I have left the field "URL parameters" empty - Is that correct?

    I have the Application Type set to "Browser" the Callback URL is set to "http://www.cottam.co.uk/"

    Also have set access type to "Read & Write".

    Any ideas what could be wrong?

  10. #10
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    Quote Originally Posted by Doublespark
    The extension says "You are authenticated. Click here to use different credentials."

    But, the log file still says "Error posting to Twitter".
    Hmmm, I don't know.

    I have left the field "URL parameters" empty - Is that correct?
    Yes, I left empty.

    I have the Application Type set to "Browser" the Callback URL is set to "http://www.cottam.co.uk/"

    Also have set access type to "Read & Write".
    It is similar to my setting.

    Any ideas what could be wrong?
    I have no idea. I found out my probem with adding some debugging code, which save the response message
    from twitter to a file. And search the reason of the error with Google.
    I think it is better News Twitter could log such message with debug mode.
    --
    Takahiro Kambe

  11. #11
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    And it isn't the case of your problem, News Twitter 1.2.0 needs these PHP extensions:

    • curl[/*:m:27gfraku]
    • json[/*:m:27gfraku]

    Since Contao core dosen't needs these extensions, it might cause problem on some
    environment.
    --
    Takahiro Kambe

  12. #12
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    I contacted my hosts. Both curl and json are installed by default.

    Looks as though I will have to give up :cry:

    Thanks for your help.

  13. #13
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    Hi,

    I used a such debugging code. What will be remain your /var/tmp/oalog??

    Code:
    --- system/modules/newstwitter/TwitterOAuth.php.orig    2010-10-12 08:19:44.000000000 +0000
    +++ system/modules/newstwitter/TwitterOAuth.php
    @@ -78,6 +78,11 @@ class TwitterOAuth {
           $parameters['oauth_callback'] = $oauth_callback;
         } 
         $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
    +
    +    $fh = fopen("/var/tmp/oalog", "a");
    +    fwrite($fh, $reuest . "\n");
    +    fclose($fh);
    +
         $token = OAuthUtil::parse_parameters($request);
         $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
         return $token;
    --
    Takahiro Kambe

  14. #14
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    Hi Taca, where do I put this code?

  15. #15
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    It's in code, "diff -u" output: system/modules/newstwitter/TwitterOAuth.php, to line 81 for 5 lines.
    --
    Takahiro Kambe

  16. #16
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    I have changed the code as follows:

    Code:
      function getRequestToken($oauth_callback = NULL) {
        $parameters = array();
        if (!empty($oauth_callback)) {
          $parameters['oauth_callback'] = $oauth_callback;
        } 
        $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
        $fh = fopen("/home/cottamg/mainwebsite_html/oalog", "a");
         fwrite($fh, $reuest . "\n");
         fclose($fh);
         $token = OAuthUtil::parse_parameters($request);
         $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
         return $token;
      }
    Do I need to create a file called oalog first? Does it need an extension?

    Ta.

  17. #17
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    You don't need to create a file unless permission is allowed to write to "/home/cottamg/mainwebsite_html" directory.
    If no write permission, create "/home/cottamg/mainwebsite_html/oalog" with 0666 permission.

    A file's extension is a matter of when reading it, not creating it.
    --
    Takahiro Kambe

  18. #18
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    Nothing ever gets written to the file.

    It must be inside an if statement that stops it getting called?

  19. #19
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    Hmmm, it may be another reason.

    If you change these setting and still you can't tweet?

    • Make "Consumer key" and "Consumer secret" empty.[/*:m:a0yklnmy]
    • Allow your twitter account access from news twitter.[/*:m:a0yklnmy]
    --
    Takahiro Kambe

  20. #20
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    I do not see where the "Consumer key" and "Consumer secret" fields are.

    Thanks for you help taca, I have spent hours trying to get this to work, reluctantly I had better give up on this extension!!

  21. #21
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    Quote Originally Posted by Doublespark
    I do not see where the "Consumer key" and "Consumer secret" fields are.
    On Bacakend, System -> Setting.
    --
    Takahiro Kambe

  22. #22
    User
    Join Date
    06-19-09.
    Posts
    417

    Default Re: newstwitter

    Strange that they they there, would have thought they would be in with the "Twitter Authentication" button. It's confusing having settings in different places.

    I emptied both the "Consumer key" and "Consumer secret" fields, still no go.

  23. #23
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: newstwitter

    Quote Originally Posted by Doublespark
    Strange that they they there, would have thought they would be in with the "Twitter Authentication" button. It's confusing having settings in different places.
    Because they are different items and latter is need for each News Archive.

    • "Consumer key" and "Consumer secret" are setting of key/secret for your site by Twitter.[/*:m:3i04wu4u]
    • "Twitter Authentication" button generate authentication information for each News Archve.[/*:m:3i04wu4u]


    [quote="Doublespark"I emptied both the "Consumer key" and "Consumer secret" fields, still no go.[/quote]
    If you use empty "Consumer key" and "Consumer secret", News Twitter uses its author's "Consumer key"
    and "Consumer secret", so it should succeed.

    I still wonder PHP's curl extention is really enabled or not (could be check with phpinfo()) since posting to
    Twitter uses curl funcions.
    --
    Takahiro Kambe

  24. #24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •