• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

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