Twitter integration

When a job is approved it can be sent to Twitter automatically.

First thing you need to do (if you haven’t already done so) is to register at http://twitter.com

  1. Go to dev.twitter.com sign in with your Twitter credentials, next click “Register an application” link
  2. Fill the form, it’s automatically accepted so Twitter guys probably don’t check it all, but still … keep it proffesional. One important thing here is to select “Read and Write” on “Default Access type”. Click “Register Application” and you’re done
  3. Now you will need 4 keys to make your app work. Go to “My Applications” then click on your newly created app title. Scroll down and copy into WPJobBoard -> Configuration -> Twitter, “Consumer Key” and “Consumer Secret”, “Access Token” and “Access Token Secret” into the configuration
  4. Check “Tweet Jobs” checkbox, so the jobs will be actually tweeted
  5. Enter “Tweet Template” if it’s empty. The recommended value is “{title} {$url} #{category} #{type}”
  6. Click Save Changes

Now, all your jobs should be tweeted once they become active on the job board.

If you would like to use different variables in the tweet template, than the ones that are avaialble by default, you can use wpjb_tweet_template filter, here is an example on how to add city and company name:

add_filter("wpjb_tweet_template", "my_tweet_template");
function my_tweet_template($msg, $job) {
  $find = array("{company}", "{city}");
  $repl = array($job->company_name, $job->job_city);
  return str_replace($find, $repl, $msg);
}

Put this code in your theme functions.php file and now you can use {company} and {city} variables in Tweet Template. The $job variable used in my_tweet_template function is a Wpjb_Model_Job object.

  1. I’m trying to set this up so the Jobs are automatically uploaded to twitter and also facebook to save me adding them myself, however i can’t seem to get past step 2, the only form i find is one called “create an Appt” which i don’t think is the same as it askes questions such as Discription “Your application description, which will be shown in user-facing authorization screens.” is this the correct form? if it is I’m not really sure how to fill it out- or once i log into dev.twitter.com where do i find the Register an application” link? Thank you.

    • Greg
      Reply

      The guide should be ok, i wrote it while registering my own Twitter application so the links are correct … unless Twitter made some changes in the dev panel.

  2. I have added the plugin and followed all the instructions.

    When jobs are added will it only add actual jobs or should tweet all the imported ones as well ??

    I have imported about 50 jobs from Career builder etc and none have appeared on the twitter account – theukjobssite so I thought I should ask. I have set up the app etc and included all the tokens as advised.

    Kind regards
    John Scott

    • Greg
      Reply

      @John, jobs imported from CareerBuilder or Indeed are not Tweeted, only the ones you add manually from wp-admin or fronted.

  3. Jerry Stevenson
    Reply

    I’ve followed the instructions and I’m still not seeing posts to the Twitter account. Is there a way of turning on logging so I can tell where the problem may lie? Are there any PHP configuration settings you’re aware of that might cause this functionality to fail?

    Thanks!

  4. Greg
    Reply

    @Jerry, the best way to enable debugging is to open file wpjobboard/application/libraries/Model/Job.php and change line
    //echo $e->getMessage();
    to
    echo $e->getMessage();

    Then once the job is approved you should see an error (if any).

  5. Rob Smith
    Reply

    Just to confirm, if you visit https://dev.twitter.com/ there is no “Register an Application” only “Add Twitter to your Website” or “Create an Application”? Can you confirm which is the correct link?

    Thanks

  6. Is there any chance the auto posting jobs to LinkedIn will be available soon?

    • It’s more likely that the Apply from LinkedIn will be implemented sooner, however if it will turn out to be quite easy to it posting to LinkedIn might be added as well.

  7. Is this functionality still supported?

    • Yes, this is still supported, although most likely you do not need the snippet at the end anymore as the integration was extended so pretty much any variable can be now used.

  8. nick32601@yahoo.com
    Reply

    each twitter post has #indeed #jobs

    How do i change/delete that?

    • Greg
      Reply

      The content of tweet you can edit from wp-admin / Settings (WPJB) / Twitter panel in “Tweet Template” field.

  9. I have set up the twitter integration. When I click on the ‘Save and send test tweet’ button, it tells me the tweet has been sent. Yet I never see it on my timeline. I’ve also input a job to test this and it does not get tweeter either.

    I’ve reset and confirm all the keys, they are correct.

    Thanks for your help.

    • Greg
      Reply

      It should appear instantly, most common issue with the Twitter integration is that in dev.twitter.com panel, user give the app read only permissions, please make sure that it has read / write capabilities.

  10. I used the tweet template you recommended but the link to the job post does not show in the tweet.

    • If tweets do not show on the timeline please use “send test tweet” button in Twitter Configuration page it should show what the problem is.

Leave a Reply

Your email address will not be published.