9 | This app no longer works. These days I'm busy with work, and
10 | don't have time to find & fix the issue. I suspect that Twitter changed some authentication setting.
11 | The code/logic in the GitHub repo is still functional, so feel free to try and fix the app yourself.
12 | Myself and others would appreciate it!
13 |
14 | Twitter Boost Tools is a FREE web application to boost your Twitter
15 | account stats/follower engagement. For more information and to see the
16 | source code of the project, check out the GitHub
18 | repository. Created by @warrencrasta. Feel free to contact me if you have specific Twitter needs.
20 |
Tools:
21 |
22 |
Unfollow users who don't follow you (with an option to
23 | save a group of people from being unfollowed).
24 |
25 |
Follow users based on a keyword they tweeted (can follow a
26 | maximum of 1000 people every 24 hours).
27 |
Follow users based on a keyword in their bio (can follow a
28 | maximum of 1000 people every 24 hours).
29 |
Favorite tweets based on a keyword (can favorite a maximum of
30 | 1000 tweets every 24 hours).
31 |
Unfavorite all (or some) of your favorited tweets.
32 |
*NEW* ($5) Get 60 verified Twitter followers (accounts with the blue checkmark).
8 | This app no longer works. These days I'm busy with work, and
9 | don't have time to find & fix the issue. I suspect that Twitter changed some authentication setting.
10 | The code/logic in the GitHub repo is still functional, so feel free to try and fix the app yourself.
11 | Myself and others would appreciate it!
12 |
13 | Twitter Boost Tools is a FREE web application to boost your Twitter
14 | account stats/follower engagement. For more information and to see the
15 | source code of the project, check out the GitHub
17 | repository. Created by @warrencrasta. Feel free to contact me if you have specific Twitter needs.
19 |
Unfollow everyone who doesn't follow you. If you want to
13 | make sure that some people are safe from being unfollowed, you may do
14 | so using the radio buttons below. The lists below refer to Twitter
16 | lists, which you can add/remove members from.
17 |
18 |
40 |
64 |
65 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TwitterBoost-Tools
2 |
3 | **NOTE:** As of Sep 24, 2017, this project is no longer being maintained.
4 |
5 | A web application to boost your Twitter account stats/follower engagement. I've used these tools sporadically to grow my own Twitter account, [@warrencrasta](https://twitter.com/warrencrasta), with tremendous success. If you liked this project, or found these tools interesting, please consider starring the repository.
6 |
7 | **Link to app:** http://twitterboost-tools.herokuapp.com/
8 |
9 | **NOTE:** Use this program within the bounds of the [Twitter Terms of Service](https://twitter.com/tos?lang=en). Please do not abuse this application.
10 |
11 | ## Possible Uses For This Application
12 |
13 | I have used this program sporadically to follow 1000 people a day based on a keyword they tweeted/a keyword in their bio. I also favorite 1000 tweets a day. I tweet about basketball/school a lot, so I use keywords related to basketball/school in order to increase the chance of them following me back. **Typically, I gain about 100 *real* new followers a day, and lots of *real* RTs/Favorites on my tweets.** A few days later, I use the tool to unfollow users who don't follow me back and to unfavorite all of my tweets.
14 |
15 | ## Instructions For Contributing/Installation
16 |
17 | Feel free to contribute to this project! There are many improvements that can be made, both in terms of code quality and in terms of whole new ideas that can be implemented. If you encounter a bug, please let me know.
18 |
19 | **To Develop:**
20 |
21 | 1. Clone the repository.
22 | 2. Open Eclipse IDE (Java EE perspective) and import this repo as a Maven project.
23 | 3. Create a Tomcat server in Eclipse and add the project to the Tomcat server.
24 | 4. Go to [https://apps.twitter.com/](https://apps.twitter.com/) and create a Twitter Application. Go to the Keys and Access Tokens tab of your application and note the **Consumer Key (API Key)** and **Consumer Secret (API Secret)**.
25 | 5. Edit **src/main/java/com/utils/Setup.java** with the appropriate values. For DB_URL, create a PostgreSQL database and a table called twitter_user. See **postgresql.txt** in this repo for the create table query. The DB_URL should look like: `jdbc:postgresql://:/?user=&password=&sslmode=require` but some trial-and-error might be needed. For more information, Google "PostgreSQL JDBC connection".
26 | 6. Follow existing coding conventions.
27 |
28 | The steps above are just high-level descriptions of how to set up the development environment. Setting up Tomcat in Eclipse with Maven can be tricky.
29 |
30 | If you do contribute, be advised that it may take some time to get your PR merged in. If you're interested in being a collaborator, e-mail me. If you don't know how to implement something, but do have an idea that you would like to see implemented, feel free to shoot me an e-mail and I can try to implement it.
31 |
32 | ## Credits
33 |
34 | Author: Warren Crasta (warrencrasta@gmail.com)
35 |
36 | Created with the help of [Twitter4J](http://twitter4j.org/en/index.html). Thank you to [Dasari Srinivas](http://blog.sodhanalibrary.com/2016/05/login-with-twitter-using-java-tutorial.html) for providing much of the boilerplate code.
37 |
--------------------------------------------------------------------------------
/src/main/java/com/sl/db/DBConn.java:
--------------------------------------------------------------------------------
1 | package com.sl.db;
2 |
3 | import java.sql.Connection;
4 | import java.sql.DriverManager;
5 | import java.sql.PreparedStatement;
6 | import java.sql.ResultSet;
7 | import java.sql.SQLException;
8 | import java.sql.Statement;
9 |
10 | import com.utils.Setup;
11 |
12 | public class DBConn {
13 | Connection con = null;
14 | static String className = "class sodhana.sdb.connection.DBConnection";
15 |
16 | /**
17 | * @return
18 | * @throws ClassNotFoundException
19 | * @throws SQLException
20 | * To Create Connections
21 | */
22 | public static Connection getConnection() throws ClassNotFoundException, SQLException {
23 | Class.forName("org.postgresql.Driver");
24 | Connection connection = null;
25 | connection = DriverManager.getConnection(Setup.DB_URL);
26 | return connection;
27 | }
28 |
29 | /**
30 | * @param con
31 | * @param stmt
32 | * @param rs
33 | * To close statements, result sets and Connection
34 | */
35 | public static void close(Connection con, Statement stmt, ResultSet rs) {
36 | try {
37 | if (rs != null) {
38 | rs.close();
39 | }
40 | if (stmt != null) {
41 | stmt.close();
42 | }
43 | if (con != null) {
44 | con.close();
45 | }
46 | } catch (SQLException e) {
47 | e.printStackTrace();
48 | } catch (Exception e) {
49 | e.printStackTrace();
50 | }
51 | }
52 |
53 | /**
54 | * @param con
55 | * @param stmt
56 | * To close statements and Connection
57 | */
58 | public static void close(Connection con, Statement stmt) {
59 | try {
60 | if (stmt != null) {
61 | stmt.close();
62 | }
63 | if (con != null) {
64 | con.close();
65 | }
66 | } catch (SQLException e) {
67 | e.printStackTrace();
68 | } catch (Exception e) {
69 | e.printStackTrace();
70 | }
71 | }
72 |
73 | /**
74 | * @param con
75 | * @param pstmt
76 | * @param rs
77 | * To Close PreparedStatement and Connection
78 | */
79 | public static void close(Connection con, PreparedStatement pstmt,
80 | ResultSet rs) {
81 | try {
82 | if (rs != null) {
83 | rs.close();
84 | }
85 | if (pstmt != null) {
86 | pstmt.close();
87 | }
88 | if (con != null) {
89 | con.close();
90 | }
91 | } catch (SQLException e) {
92 | e.printStackTrace();
93 | } catch (Exception e) {
94 | e.printStackTrace();
95 | }
96 | }
97 |
98 | /**
99 | * @param con
100 | * To close connection
101 | */
102 | public static void closeConnection(Connection con) {
103 | try {
104 | if (con != null)
105 | con.close();
106 | } catch (SQLException e) {
107 | e.printStackTrace();
108 | } catch (Exception e) {
109 | e.printStackTrace();
110 | }
111 | }
112 |
113 | /**
114 | * @param conn
115 | * @throws SQLException
116 | * To Commit and Close the connection
117 | */
118 | public static void commitAndClose(Connection conn) throws SQLException {
119 | conn.commit();
120 | conn.close();
121 | }
122 |
123 | public static void main(String args[]) throws ClassNotFoundException, SQLException {
124 | getConnection();
125 | }
126 |
127 | }
--------------------------------------------------------------------------------
/src/main/java/com/sl/dao/TwitterDAO.java:
--------------------------------------------------------------------------------
1 | package com.sl.dao;
2 |
3 | import java.sql.Connection;
4 | import java.sql.PreparedStatement;
5 | import java.sql.ResultSet;
6 | import java.sql.SQLException;
7 | import com.sl.db.DBConn;
8 | import com.sl.db.DBException;
9 | import com.sl.pojo.UserPojo;
10 |
11 |
12 | public class TwitterDAO {
13 |
14 | public static UserPojo selectUser(String userId) throws DBException {
15 | Connection conn = null;
16 | PreparedStatement ps = null;
17 | ResultSet res = null;
18 | UserPojo pojo = null;
19 | try {
20 | conn = DBConn.getConnection();
21 | ps = conn.prepareStatement("select * from twitter_user where user_id = ?");
22 | ps.setString(1, userId);
23 | res = ps.executeQuery();
24 | if (res != null) {
25 | while (res.next()) {
26 | pojo = new UserPojo();
27 | pojo.setUser_id(res.getInt(1));
28 | pojo.setTwitter_user_id(res.getLong(2));
29 | pojo.setTwitter_screen_name(res.getString(3));
30 | pojo.setAccess_token(res.getString(4));
31 | pojo.setAccess_token_secret(res.getString(5));
32 | }
33 | }
34 | DBConn.close(conn, ps, res);
35 | } catch (ClassNotFoundException | SQLException e) {
36 | DBConn.close(conn, ps, res);
37 | throw new DBException(e.toString());
38 | }
39 | return pojo;
40 | }
41 |
42 |
43 | public static UserPojo selectTwitterUser(long user_id) throws DBException {
44 | Connection conn = null;
45 | PreparedStatement ps = null;
46 | ResultSet res=null;
47 | UserPojo pojo = null;
48 | try {
49 | conn = DBConn.getConnection();
50 | ps = conn.prepareStatement("select * from twitter_user where twitter_user_id = ?");
51 | ps.setLong(1, user_id);
52 | res = ps.executeQuery();
53 | if (res != null) {
54 | while (res.next()) {
55 | pojo = new UserPojo();
56 | pojo.setUser_id(res.getInt(1));
57 | pojo.setTwitter_user_id(res.getLong(2));
58 | pojo.setTwitter_screen_name(res.getString(3));
59 | pojo.setAccess_token(res.getString(4));
60 | pojo.setAccess_token_secret(res.getString(5));
61 | }
62 | }
63 | DBConn.close(conn, ps, res);
64 | } catch (ClassNotFoundException | SQLException e) {
65 | DBConn.close(conn, ps, res);
66 | throw new DBException(e.toString());
67 | }
68 | return pojo;
69 | }
70 |
71 | public static void updateAccessToken(UserPojo pojo) throws DBException {
72 | Connection conn = null;
73 | PreparedStatement ps = null;
74 | try {
75 | conn = DBConn.getConnection();
76 | ps = conn.prepareStatement("update twitter_user set access_token=?, access_token_secret=? where twitter_user_id = ?");
77 | ps.setString(1, pojo.getAccess_token());
78 | ps.setString(2, pojo.getAccess_token_secret());
79 | ps.setLong(3, pojo.getTwitter_user_id());
80 | ps.executeUpdate();
81 | DBConn.close(conn, ps);
82 | } catch (ClassNotFoundException | SQLException e) {
83 | DBConn.close(conn, ps);
84 | throw new DBException(e.toString());
85 | }
86 | }
87 |
88 |
89 | // add users vote
90 | public static void insertRow(UserPojo pojo) throws DBException{
91 | Connection conn = null;
92 | PreparedStatement ps = null;
93 | try {
94 | conn = DBConn.getConnection();
95 | ps = conn.prepareStatement("insert into twitter_user (twitter_user_id, screen_name, access_token, access_token_secret) values (?,?,?,?)");
96 | ps.setLong(1,pojo.getTwitter_user_id());
97 | ps.setString(2,pojo.getTwitter_screen_name());
98 | ps.setString(3,pojo.getAccess_token());
99 | ps.setString(4,pojo.getAccess_token_secret());
100 | ps.executeUpdate();
101 | DBConn.close(conn, ps);
102 | } catch (ClassNotFoundException | SQLException e) {
103 | DBConn.close(conn, ps);
104 | throw new DBException(e.toString());
105 | }
106 | }
107 |
108 | }
--------------------------------------------------------------------------------
/src/main/java/com/sl/PostBiokeyword.java:
--------------------------------------------------------------------------------
1 | /*
2 | * IDEAS:
3 | * Include # of users followed today in Rate Limiting Info.
4 | */
5 |
6 | package com.sl;
7 |
8 | import java.io.IOException;
9 | import java.io.PrintWriter;
10 |
11 | import javax.servlet.ServletException;
12 | import javax.servlet.annotation.WebServlet;
13 | import javax.servlet.http.HttpServlet;
14 | import javax.servlet.http.HttpServletRequest;
15 | import javax.servlet.http.HttpServletResponse;
16 |
17 | import twitter4j.*;
18 | import java.util.*;
19 |
20 | @WebServlet("/postBiokeyword")
21 | public class PostBiokeyword extends HttpServlet {
22 | @Override
23 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
24 | response.setContentType("text/html");
25 | response.setHeader("Connection", "keep-alive");
26 | response.setHeader("Transfer-Encoding", "chunked");
27 |
28 | PrintWriter out = response.getWriter();
29 | out.println("");
30 | out.println("");
31 | out.println("");
32 | out.println("Results");
33 | out.println("Tools Page");
34 | out.println("");
35 | out.println("");
36 | out.println("
Results
");
37 |
38 | String query = request.getParameter("keyword");
39 | int page = Integer.parseInt(request.getParameter("page"));
40 | int follow = Integer.parseInt(request.getParameter("follow"));
41 | int follow2 = Integer.parseInt(request.getParameter("follow2"));
42 | Twitter twitter = (Twitter)request.getSession().getAttribute("twitter");
43 | if (follow == follow2) {
44 | out.println("To stop the process at any time, click the Stop loading this page button on your browser.
");
37 |
38 | String keyword = request.getParameter("keyword");
39 | String ans = request.getParameter("RTs");
40 | int favorite = Integer.parseInt(request.getParameter("favorite"));
41 | int favorite2 = Integer.parseInt(request.getParameter("favorite2"));
42 | Twitter twitter = (Twitter)request.getSession().getAttribute("twitter");
43 | if (favorite == favorite2) {
44 | out.println("To stop the process at any time, click the Stop loading this page button on your browser.
");
45 | response.flushBuffer();
46 | Query query;
47 | if(ans.equalsIgnoreCase("yes") || ans.equalsIgnoreCase("y")) {
48 | query = new Query(keyword);
49 | } else{
50 | query = new Query(keyword + " -filter:retweets");
51 | }
52 | query.setResultType(Query.RECENT);
53 |
54 | /* Add tweets to a list. */
55 | long lastID = Long.MAX_VALUE;
56 | ArrayList tweets = new ArrayList();
57 | while (tweets.size() < favorite) {
58 | if (favorite - tweets.size() > 100)
59 | query.setCount(100);
60 | else
61 | query.setCount(favorite - tweets.size());
62 | try {
63 | QueryResult result = twitter.search(query);
64 | tweets.addAll(result.getTweets());
65 | for (Status t: tweets)
66 | if(t.getId() < lastID) lastID = t.getId();
67 | }
68 | catch (TwitterException te) {
69 | out.println("Couldn't retrieve tweets: " + te + " ");
70 | response.flushBuffer();
71 | break;
72 | };
73 | query.setMaxId(lastID-1);
74 | }
75 | /* Favorite all users in the tweets list. */
76 | for (int i = 0; i < tweets.size(); i++){
77 | Status s = tweets.get(i);
78 | try {
79 | twitter.createFavorite(s.getId());
80 | out.println(i+1 + ". Favoriting tweet by @" + s.getUser().getScreenName() + ". ");
81 | response.flushBuffer();
82 | } catch (TwitterException te) {
83 | /* Ignore any errors and keep running. */
84 | if (te.toString().contains("Your account may not be allowed to perform this action.")) {
85 | out.println("Couldn't favorite tweets: " + te + " ");
86 | response.flushBuffer();
87 | break;
88 | }
89 | }
90 | }
91 | out.println("