Giter Site home page Giter Site logo

mrbellek / twitterbot Goto Github PK

View Code? Open in Web Editor NEW
142.0 142.0 42.0 10.97 MB

Several PHP scripts for making Twitter bots that retweet certain terms, or post from a data source (rss, database, markov body, picture folder).

License: Other

PHP 91.81% CSS 0.01% JavaScript 7.75% HTML 0.37% Shell 0.05%
twitter twitter-api twitter-oauth

twitterbot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitterbot's Issues

Where can I host a bot script?

Are there any free solutions for hosting a PHP bot script? I know about hosting a node.js bot on Heroku, but I'm not sure if Heroku is a good fit for a PHP script. Any suggestions?

The retweetbot doesn't read the json file properly

Hi,
First, Thank you for this amazing app.
In my code, I specefied a json file with this command: sSettingsFile but the problem is, it doesn't read it properly, for example:
in the filter section in my json file I have:

"filters": [
"t.co", "goo.gl" ,"http", "https",".com",".net",
],

and other words,, but it still showing tweets with those words..

In dice section I have:

"dice": {
		"media": 1.0,
		"urls": 0.0,
		"mentions": 0.0,
		"base": 0.7
	}

but I can clearly see links and mentions after executing my app

If I have to add something, I duplicated the retweetbot example and used it, I only changed the words and data in the json file and the main php file.

Convert to OO: Holidaysbot

Old script: single-purpose/holidaysbot.php
New scripts: oo/holidaysbot.{php|json|inc.php}

This bot pulls data from the database (thank god) and attaches semi-random results from Google Image Search to tweets.

Convert to OO: exactotweet

Old script: single-purpose/exactotweet.php
New scripts: oo/exactotweet.{php|json|inc.php}

Note that this bot quotes tweets in its timeline (i.e. quotes its followers), allow_mentions should be true.

Update logger documentation

The logger page has zero documentation, and throws an unclear error when you open it without setting an .inc file for database access. It should show a clear message indicating the user what to do, and the Github documentation should include a section on what the page does and how it works.

Remove content from tweet that's already attached to it

When a tweet var field is filled with something that can be attached as a picture/clip, and it has no more content behind the link beyond what is in the attachment (single picture imgur gallery, direct picture link, gifv link etc), it should not be included in the tweet.

This saves characters and prevents useless links in the tweet.

Implement config setting allow_mentions

To prevent bots from accidentally tagging someone on twitter who didn't ask for it (against the Twitter ToS) because output pulled from the db or rss feed contains a @.

Implement a setting $allow_mentions that's false by default and gets checked after a tweet has been composed, and escapes any @-s with a / or .

Bots that reply to mentions should set this to true (e.g. DSTnotify).

Turn off output for cron

It would be a nice feature if we could turn off screen output i.e. echo 'Getting blocked users..
';
This could be controlled via a variable within the inc file.
Thanks for the work on this.

Update Media lib to support Reddit image galleries

Reddit allow users to post multiple images in a post. This results in the media link to be something like 'reddit.com/gallery/tvptpt', but the media module displays this as 'crosslink' and will not attach the pictures. The module must be updated to properly detect a gallery, pick up to 4 random pictures from it, and attach those to the tweet.

This was implemented earlier for posts that linked to Imgur galleries, but since Reddit has implemented their own version of galleries, those aren't used anymore.

Filters

Using the json filter file:
"filters": [
"#alternative",
"blockchain",
"gaming"
],
Hoping this will exclude tweets with the hashtag #alternative kind of works.
However, it also excludes #alternativemusic or #alternativeclothing
Is there a way to make the match more exact.
Thanks

Always load db lib in libraries

Manually loading lib/db when needed is getting out of hand. Since a bot can not use the db but use the logger that does, I used to load the db in the logger lib when it wasn't already, but that messes up all sorts of things.

Change so that db lib is loaded in lib/base so all libs have access to it, including lib/logger.

Convert custom/gis lib to use customsearch api v2

Google emailed me on March 23rd:

The Custom Search Element API 1.0, which was deprecated in 2012 in favor of API 2.0, is now no longer maintained. API 1.0 may experience outages and failures, and possibly stop working entirely.

You’re receiving this message because our records show you might currently be using the Custom Search Element API 1.0. You can confirm if you’re using this version by looking at the code on your search page for a call to google.search.CustomSearchControl.

Next Steps

To avoid any potential interruptions in service, please update your website to use the Custom Search Element API 2.0. The easiest way to transition is through the CSE Control Panel at cse.google.com, where you can generate your new Custom Search Engine code and add it to your website.

Logview page issues

The logview page has some problems:

  • doesn't show bot name (might already be fixed?)
  • doesn't show log levels, showing everything as ERROR

Fix so that lib/format respects the config setting attach_image

There is a .json setting that specifies if the content of a tweet var should be attached to the tweet, if possible. It's not being used - right now the function that checks redditmediatype (either in lib/format or lib/media, not sure off the top of my head) determines if it's going to try and attach the content.

Convert from OAuth.php/twitteroauth to abraham/twitteroauth library

This is probably the last piece of code in here that hasn't changed from the original source I forked from. It's really outdated, didn't support media upload (which I added) and is formatted like a blind moose.

Start using the abraham/twitteroauth lib that's actively maintained, and can probably upload movie clips and gifs/webm/gifv to boot.

Convert to OO: Unicodetweet

Old script: single-purpose/unicodebot.php
New scripts: oo/unicodetweet.{php|json|inc.php}

Bot posts random unicode characters with their descriptions. Note that single-purpose/unicode.json is used.

The function that specifies which characters are smileys/emojis should probably be moved to a .json setting block.

Picture bot: fetch picture's descriptions from a JSON file

Hello,

Firstly, thank you for the job you made for this tool, it is very useful for people who have only an intermediary level in PHP (as I am).

I would like to ask for an enhancement about the Picture bot's script. It works well but it is still very rough concerning the tweet text content which is associated with the pictures. It is especially currently impossible to add any links, which would be very useful to mention the sources of the files, or to mention a webpage associated with the topic of the pictures.

That's why it would be very useful to have an option to declare a JSON file in which the bot could fetch extra informations to add to the tweets. (JSON files are better than database in this case, in my opinion, because it is very light and easily editable).

Thank you in advance !

Prevent duplicate tweets

When someone retweets the same content, say 3 times, is it possible to prevent the retweet bot retweeting all three posts ?

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.