Domanda

On my Drupal 7 site, when I create new content (e.g. a blog post), I want that content to automatically publish to my Twitter feed. In other words, if I create a new blog post, I want notification of that new post published to twitter. I've done a number of searches on this topic and have not found a solution. I installed and enabled the twitter module and followed all instructions for configuring the module and registering my app with Twitter. I can read my Twitter feed into the site but I cannot publish to Twitter. Can anyone provide instructions for updating my Twitter feed whenever new content is published on my Drupal site?

thanks,

È stato utile?

Soluzione 2

Ok - I found the solution. Maybe I missed this in the various tutorials and documentation I read but, to get the module to post to Twitter, I had to "Go to Twitter and add and authenticated account" last in the process. Even though the account was already listed under Administration/Configuration/Web Services/Twitter and all setting correct. I deleted the account and re-Authenticated the same account. Then everything worked; content was posted to Twitter and read into Drupal (after running cron). I tested this process on three different sites and, in all cases, that's how I got the post functionality to work.

Altri suggerimenti

You need to enable twitter post and twitter action modules, bundled with twitter module itself.

Go to twitter settings and configure post settings to display on blogs. You would see a checkbox while creating a new blog post saying "Post to twitter". If you tick the checkbox, a message will get posted on twitter.

Alternatively,

Create a rule with following config:

Event: After saving new content

Condition: Content is of type blog

Action: Post a message on twitter

{ "sp_socialshare_feature_post_on_twitter" : {
    "LABEL" : "Post on Twitter",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : true,
    "REQUIRES" : [ "rules", "twitter_actions" ],
    "ON" : { "node_insert" : [] },
    "IF" : [
      { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "blog" : "blog" } } } }
    ],
    "DO" : [
      { "rules_core_twitter_actions_set_status_action" : { "message" : "[node:title] [node:url]", "sender" : "[current user]" } }
    ]
  }
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top