Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cyrillic symbols in a tweet

Tags:

php

twitter

api

I use EpiTwitter , it works fine , but when $varx have cyrillic symbols

$varx="Привет";
$status=$Twitter->post_statusesUpdate(array('status' => $varx));

api answers

'error' => string 'Could not authenticate with OAuth.' 
  'request' => string '/statuses/update.json' 

i've tryed many variations like urlencode,json_encode on $varx , but it post answers of this functions my file is utf-8 without BOM , also i've tryed ansi

any ideas ?

like image 837
Artem Kolesnikov Avatar asked Nov 04 '22 00:11

Artem Kolesnikov


1 Answers

Artem, i think problem not in cyrillic symbols. Did you register your application in twitter (http://twitter.com/oauth_clients)? You will get consumer key and consumer secret. Then define it in your php application:

define('TWITTER_CONSUMER_KEY', 'your_consumer_key');  
define('TWITTER_CONSUMER_SECRET', 'your_consumer_secret');  

More info here

like image 59
Ramil Amerzyanov Avatar answered Nov 13 '22 15:11

Ramil Amerzyanov