Incorrect string value: ‘\xF0\x9F\x8E\xB6\xF0\x9F…’ MySQL

I was finally able to figure out the issue. I had to change some settings in mysql configuration my.ini This article helped a lot http://mathiasbynens.be/notes/mysql-utf8mb4#character-sets First i changed the character set in my.ini to utf8mb4 Next i ran the following commands in mysql client SET NAMES utf8mb4; ALTER DATABASE dreams_twitter CHARACTER SET = utf8mb4 COLLATE … Read more

TwitteR, ROAuth and Windows: register OK, but certificate verify failed

I had received the error you described above in the past, but this has worked for me. #======================================================================================= ## ON windows, we need to dowload the certificate for OAUTH ## NOTE: you will need to setup an app on Twitter ## dev.twitter.com <- get your KEY/SECRET #======================================================================================= ########################################################################## ## Load packages ########################################################################## library(twitteR) library(ROAuth) ## … Read more

Twitter API returns error 215, Bad Authentication Data

A very concise code without any other php file include of oauth etc. Please note to obtain following keys you need to sign up with https://dev.twitter.com and create application. <?php $token = ‘YOUR_TOKEN’; $token_secret=”YOUR_TOKEN_SECRET”; $consumer_key = ‘CONSUMER_KEY’; $consumer_secret=”CONSUMER_SECRET”; $host=”api.twitter.com”; $method = ‘GET’; $path=”/1.1/statuses/user_timeline.json”; // api call path $query = array( // query parameters ‘screen_name’ => … Read more

How to force Share Intent to open a specific app?

For Facebook public void shareFacebook() { String fullUrl = “https://m.facebook.com/sharer.php?u=..”; try { Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setClassName(“com.facebook.katana”, “com.facebook.katana.ShareLinkActivity”); sharingIntent.putExtra(Intent.EXTRA_TEXT, “your title text”); startActivity(sharingIntent); } catch (Exception e) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(fullUrl)); startActivity(i); } } For Twitter. public void shareTwitter() { String message = “Your message to post”; try { Intent sharingIntent … Read more

twitter integration on android app

This is how I do it First i made a Dialog for the webview Twitter_Dialog.java public class Twitter_Dialog extends Dialog { static final int BLUE = 0xFF6D84B4; static final float[] DIMENSIONS_DIFF_LANDSCAPE = { 20, 60 }; static final float[] DIMENSIONS_DIFF_PORTRAIT = { 40, 60 }; static final FrameLayout.LayoutParams FILL = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT); static final … Read more

regex for Twitter username

(?<=^|(?<=[^a-zA-Z0-9-_\.]))@([A-Za-z]+[A-Za-z0-9-_]+) I’ve used this as it disregards emails. Here is a sample tweet: @Hello how are @you doing @my_friend, email @000 me @ [email protected] @shahmirj Matches: @Hello @you @my_friend @shahmirj It will also work for hashtags, I use the same expression with the @ changed to #.

{” was not expected.} Deserializing Twitter XML

Either decorate your root entity with the XmlRoot attribute which will be used at compile time. [XmlRoot(Namespace = “www.contoso.com”, ElementName = “MyGroupName”, DataType = “string”, IsNullable=true)] Or specify the root attribute when de serializing at runtime. XmlRootAttribute xRoot = new XmlRootAttribute(); xRoot.ElementName = “user”; // xRoot.Namespace = “http://www.cpandl.com”; xRoot.IsNullable = true; XmlSerializer xs = new … Read more