Coder Social home page Coder Social logo

ferranpons / twitter-gradle-plugin Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 214 KB

๐Ÿฆ Gradle plugin that generates a gradle task for sending Twitter updates

Home Page: https://plugins.gradle.org/plugin/com.ferranpons.twitterplugin

License: Apache License 2.0

Java 97.48% Shell 2.52%
twitter twitter-client gradle-plugin twitter4j twitter4j-library java gradle-java gradle

twitter-gradle-plugin's Introduction

Twitter Gradle Plugin

Gradle plugin

Build Status

Generates a gradle task for sending Twitter updates.



Features | How to use it | Who Made This | Contribute | Bugs and Feedback | License


Features

  • Gradle task ("createTweet") that send tweets with your user.

How To use it

Step 1

  • You must add your mobile phone to your Twitter profile before creating an application.
  • Go to: Settings -> Add Phone -> Add number -> Confirm -> Save
  • Do not forget to turn off all text notifications.

Step 2

  • Set up a new app
  • Go to: Twitter Apps -> Create New App -> Leave Callback URL empty -> Create your Twitter application
  • You should see "Your application has been created. Please take a moment to review and adjust your application's settings".

Step 3

  • By default, app's access level is read-only. To send out tweets, it requires write permission.
  • Go to: Permissions tab -> What type of access does your application need? -> Choose Read and Write -> Update settings
  • You should see "The permission settings have been successfully updated. It may take a moment for the changes to reflect."

Step 4

  • Time to get the keys and access tokens for OAuth.
  • Go to: Keys and Access Tokens tab. You'll see this under "Your Access Token" : You haven't authorized this application for your own account yet. By creating your access token here, you will have everything you need to make API calls right away. The access token generated will be assigned your application's current permission level.
  • Click Create my access token
  • You should see "Your application access token has been successfully generated. It may take a moment for changes you've made to reflect. Refresh if your changes are not yet indicated. This access token can be used to make API requests on your own account's behalf. Do not share your access token secret with anyone."
  • Verify that you see access token/secret - and the permission is set to "read and write".
  • From this page, note down the Access Token, Access Token Secret, Consumer Key (API Key), Consumer Secret (API Secret). Consumer Key/Secret help twitter identify the app and Access Token/Secret help twitter identify the user (that is you).

Step 5

Add to your build.gradle file this:

buildscript {
  repositories {
    jcenter()
    maven {
      url  "https://dl.bintray.com/ferranpons/maven"
    }
  }
  dependencies {
    classpath 'com.ferranpons:twitter-gradle-plugin:1.0.2'
  }
}

apply plugin: 'twitter-gradle-plugin'


// All the data required to send a tweet, you have to fill it
twitterPlugin {
  consumerKey = "consumer key"
  consumerSecret = "consumer secret"
  accessToken = "access token"
  accessTokenSecret = "access token secret"
  message = "tweet message"
}

Step 6

You're done. Now you only need to execute the "createTweet" task. ;)

Who made this

Ferran Pons
Ferran Pons

Contribute

  1. Create an issue to discuss about your idea
  2. [Fork it] (https://github.com/ferranpons/twitter-gradle-plugin/fork)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request
  7. Profit! โœ…

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.

License

Copyright 2017 Ferran Pons.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.