• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Twitter Automation/Google Ads

techscrap

Chevereto Member
I've been looking for ways to post images to twitter either at a random interval or when new images get uploaded. I don't like customizing things to much and why reinvent the wheel if someone has already solved this problem.

Is this possible or something sorta easy to setup?

Also is there a way to add google ads to an image hosting website?
 
Sure is easy to add autotweet, but you have to remember that twitter API is limited so you can't send a unlimited number of tweets. Anyway, the way of doing this is by putting the tweet code when the upload is complete. Like, class.upload.php then insert the code.
 
Would it be something similar to this example? I was thinking about putting this in the file you suggested around line 468.

<?php
$consumerKey = 'your-consumer-key';
$consumerSecret = 'your-consumer-secret';
$oAuthToken = 'your-access-token';
$oAuthSecret = 'your-token-secret';

require_once('twitteroauth.php');

$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);

$tweet->post('statuses/update', array('status' => '$image_filename'));

?>
 
You can do that or just a curl exec.

PHP:
function postToTwitter($username,$password,$message) {
    $host = "http://twitter.com/statuses/update.xml?status=".urlencode(stripslashes(urldecode($message)));
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $host);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
    curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
    curl_setopt($ch, CURLOPT_POST, 1);
    $result = curl_exec($ch);
    curl_close($ch);
}

Then:
PHP:
postToTwitter("twitter user","twitter pass","tweet contents");

Btw, you have a limit on how many tweets you can submit each hour.
 
Back
Top