Accessible Twitter

7. September 2009

Accessible Twitter is an alternative to the Twitter.com website. It is designed to be easier to use and is optimised for disabled users. It is still in alpha but worth checking out if you need an accessible version of Twitter.

Accessibility ,

To Follow or Unfollow, That is the Twitter Question

23. August 2009

TwitterTo follow, or not to follow, that is the question: Is it nobler to suffer the tweets and musings of those who don't interest you or is it better to click the unfollow button? While Shakespeare, Mark Twain, and Plato quotes are fun to read and it may be interesting to view pictures of the day from certain Twitter users, there comes a time when you must manage your Twitter stream. As with most of Twitter, the seemingly simple step of unfollowing someone has its complexities.

First, consider why you followed the person in the first place. If you're following a dear friend but can't stand the endless chirps about her favorite X-factor contestant, her feelings may be hurt when you unfollow her. Will she understand that you don't share her fascination with pop music? Is your relationship strong enough in person to handle a virtual abandonment?

On the other hand, if you followed someone because you thought that they might be interesting and they aren't, the decision isn't nearly as difficult. However, before you click that unfollow button, you might want to check and see if this same person is following you. If he is following you, then consider whether you would be hurt if he unfollowed you in return. In this case, it's not hurt feelings, but rather hurt interactions. Does this person have the potential to become a major client? Is this someone that you eventually hope to do business with?

Understanding who is following you helps in deciding whom to stop following. For example, if you're following someone and she is not following you back, you have a one way Twitter relationship where you see her tweets, but she doesn't see yours. Most likely, she doesn'’t even know that you exist. A good rule of thumb is to give the people that you're following two weeks to follow you back. If they don't, consider them uninterested in what you have to say and unfollow the ones that are spammy, boring, or otherwise unfollow worthy.

Managing your Twitter stream by unfollowing disengaged people will improve your overall Twitter experience. The quality of the tweets that you see will be better and you will be interacting with people who want to interact with you. To follow or unfollow? It's not that difficult of a question.

General

Dynamically update Twitter part 2

10. June 2009

Following my previous article on Dynamically updating Twitter with Twitterizer and TinyURL Edward Lewis suggested I use bit.ly to shrink the URL. So here is the code to do that:

Public Shared Function MakeBitlyUrl(ByVal Url As String) As String
Try
If Url.Length <= 30 Then
Return Url
End If

If Not Url.ToLower().StartsWith("http") AndAlso Not Url.ToLower().StartsWith("ftp") Then
Url = "http://" & Url
End If

Dim request As Net.HttpWebRequest = WebRequest.Create("http://api.bit.ly/shorten?version=2.0.1&longUrl=" + HttpUtility.UrlEncode(Url) + "&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07")
Dim Response As WebResponse = request.GetResponse
Dim res = request.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(Response.GetResponseStream)
Dim text As String = sr.ReadToEnd
sr.Close()

Dim indexOfBefore As Integer = text.IndexOf("shortUrl"": """) + 12
Dim indexOfAfter As Integer = text.IndexOf("""", indexOfBefore)
Dim shortURL As String = text.Substring(indexOfBefore, indexOfAfter - indexOfBefore)

Return shortURL
Catch generatedExceptionName As Exception
Return Url
End Try
End Function

Thanks also to Using bit.ly URL Shortening From ASP.NET (REST/JSON) for a great code example.

.Net ,

Dynamically update Twitter

2. June 2009

Further to my previous post Twitter API and .NET I have been working on a way to dynamically update my Twitter status from my .NET web application. To get this to work I have used Twitterizer and TinyURL.

Twitterizer makes it very easy to implement. I also wanted to make sure I could also shrink the urls so I used TinyURL for this.

To start the vb class you will need the following:

Imports Twitterizer.Framework

Public Class TwitterUtils

Private Shared twitter_username As String = "YourTwitterUserName"
Private Shared twitter_password As String = "YourTwitterPassword"

The VB code for shrinking the url with TinyURL:

Public Shared Function MakeTinyUrl(ByVal Url As String) As String
Try
If Url.Length <= 30 Then
Return Url
End If
If Not Url.ToLower().StartsWith("http") AndAlso Not Url.ToLower().StartsWith("ftp") Then
Url = "http://" & Url
End If

Dim request As Net.HttpWebRequest = WebRequest.Create("http://tinyurl.com/api-create.php?url=" & Url)
Dim Response As WebResponse = request.GetResponse
Dim res = request.GetResponse()

Dim sr As StreamReader
sr = New StreamReader(Response.GetResponseStream)
Dim text As String = sr.ReadToEnd
sr.Close()
Return text
Catch generatedExceptionName As Exception
Return Url
End Try
End Function

To update my status on Twitter I used the following code:

Public Shared Sub updateStatus(ByVal post As String)
Dim RegexObj As Regex = New Regex("(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?")
Dim t As New Twitter(twitter_username, twitter_password)
t.Status.Update(RegexObj.Replace(post, TwitterUtils.MakeTinyUrl(Regex.Match(post, "(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?").Groups(0).ToString)))
End Sub

As you can see I used a regular expression to replace the url in the text with a TinyURL.

You may want to have a textbox and a seperate url field. To submit these you could use the following code:

Public Shared Sub updateStatus(ByVal post As String, Optional ByVal url As String = "")
Dim new_status As String = String.Empty
If Not url Is Nothing Then
If post.Length > 114 Then
post = post.Substring(0, 114)
End If
new_status += post & " " & MakeTinyUrl(url)
Else
new_status += post
End If

Dim t As New Twitter(twitter_username, twitter_password)
t.Status.Update(new_status)
End Sub

Twitterizer makes it simple to update your status using .NET. I have only used it for updating my status but you can use it for Direct Messages and Replies. Why not download it and start using it in your own web applications.

If you are on Twitter leave your username here for others to follow.

.Net ,

Scottish Councils on Twitter

2. June 2009

Twitter api and .NET

2. May 2009

I have been working on implementing the Twitter api into a .Net website. After some searching I discovered Twitterizer. It is a .Net dll that you can include in your project. This has made it easy for me to update my status dynamically. The problem I did find was that the URL posted was not being shrunk.

So using tinyurl I was able to include some code to convert the url to a tinyurl and post it. I found this article Shortening URLs Using TinyURL API in .NET and using the code provided I was able to shorten the url for posting.

I am currently demoing this to a client and will keep you updated on my progress.

.Net ,



Marketing & SEO Blogs - Blog Top SitesBlog Flux Directory Marketing / SEO Top Blogs Internet Marketing & SEO (Link Building) - TOP.ORG Add to Technorati Favorites TopOfBlogs