Where I can get info about posting links


Hi, ppl. Can’t find any solutions for this:

‘www.dds’ = link and takes 23 characters, but why?
i.co’ && ‘i.com’ = links too.

So can somebody told me, how twitter converts strings (and what kind of) to links or URLs. Thanks a lot?


As stated in

All the URLs will be converted via t.co into 23-char length URLs


yeah! I understand that. But where I can find something about list of URLs, what twitter try to convert? Because as I see, converting ‘www.dds’ is incorrect, it’s not a url!

i.dds, i.ing - this is correct URLs?
http://asda.as - is a URL, asda.as - isn’t

Or, another words, this is link/post 30 chars:
…even here, at community forum, input field better works, than in twitter, because my crazy link didn’t shown


http.sdfsdfsdf.sd url too. wtf???


These are gTLDs so they are indeed valid links.


ok, thanks! It’s what I want. But can somebody help with correct regExp for all this stuff?


If you have a look at the twitter-text library you should find regexs in different languages that may help you.


I saw, but I don’t understand why twitter use regexs more than 200strings and why thwy use this stupid arrs ‘한국|香港|澳門|新加坡|台灣|台湾|中國|中国|გე|ไทย|ලංකා|ഭാരതം|ಭಾರತ|భారత్|சிங்கப்பூர்|இலங்கை|இந்தியா|ଭାରତ|ભારત|ਭਾਰਤ|’ +
‘ভাৰত|ভারত|বাংলা|भारोत|भारतम्|भारत|ڀارت|پاکستان|مليسيا|مصر|قطر|فلسطين|عمان|عراق|سورية|سودان|تونس|’ +
‘بھارت|بارت|ایران|امارات|المغرب|السعودية|الجزائر|الاردن|հայ|қаз|укр|срб|рф|мон|мкд|ею|бел|бг|ελ|’ +
‘zw|zm|za|yt|ye|ws|wf|vu|vn|vi|vg|ve|vc|va|uz|uy|us|um|uk|ug|ua|tz|tw|tv|tt|tr|tp|to|tn|tm|tl|tk|’ +
‘tj|th|tg|tf|td|tc|sz|sy|sx|sv|su|st|ss|sr|so|sn|sm|sl|sk|sj|si|sh|sg|se|sd|sc|sb|sa|rw|ru|rs|ro|’ +
‘re|qa|py|pw|pt|ps|pr|pn|pm|pl|pk|ph|pg|pf|pe|pa|om|nz|nu|nr|np|no|nl|ni|ng|nf|ne|nc|na|mz|my|mx|’ +
‘mw|mv|mu|mt|ms|mr|mq|mp|mo|mn|mm|ml|mk|mh|mg|mf|me|md|mc|ma|ly|lv|lu|lt|ls|lr|lk|li|lc|lb|la|kz|’ +
‘ky|kw|kr|kp|kn|km|ki|kh|kg|ke|jp|jo|jm|je|it|is|ir|iq|io|in|im|il|ie|id|hu|ht|hr|hn|hm|hk|gy|gw|’ +
‘gu|gt|gs|gr|gq|gp|gn|gm|gl|gi|gh|gg|gf|ge|gd|gb|ga|fr|fo|fm|fk|fj|fi|eu|et|es|er|eh|eg|ee|ec|dz|’ +
‘do|dm|dk|dj|de|cz|cy|cx|cw|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|bz|by|bw|bv|bt|bs|br|bq|’ +
‘bo|bn|bm|bl|bj|bi|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ar|aq|ao|an|am|al|ai|ag|af|ae|ad|ac’ +


…and that arr is not very bad More strange another: ‘barclaycard|barcelona|bar|bank|band|bananarepublic|banamex|baidu|baby|azure|axa|aws|avianca|’ +
‘autos|auto|author|auspost|audio|audible|audi|auction|attorney|athleta|associates|asia|asda|arte|’ +
‘art|arpa|army|archi|aramco|arab|aquarelle|apple|app|apartments|aol|anz|anquan|android|analytics|’ +
‘amsterdam|amica|amfam|amex|americanfamily|americanexpress|alstom|alsace|ally|allstate|allfinanz|’ +
‘alipay|alibaba|alfaromeo|akdn|airtel|airforce|airbus|aigo|aig|agency|agakhan|africa|afl|’ +
‘afamilycompany|aetna|aero|aeg|adult|ads|adac|actor|active|aco|accountants|accountant|accenture|’ +
Why somebody in twitter use this script?


I don’t understand the question. You asked how we parse links, and I pointed you at an example of our code. What is your requirement here?


It was really easy question. Try to ask another way: Why “smth.onion” or “smth.vodka” are urls and they cost 23 characters in tweet?
“i.bananarepublic” are you seriously?


Because .onion and .vodka are TLDs.



ok. So, text like “Sometext…who am i.vodka is the best alcohol…sometext” must be 140 chars for example, but really will be 140 - 7 + 23 = 156 chars and won’t be posted correctly. It’s just simple example. In future, when all words will be TLDs, how people will use twitter?


Thanks for the feedback.

Twitter does not set the rules regarding what is or is not permissible as a domain name. We regularly update our parsing libraries with new gTLDs as they are approved by ICANN. All valid domains will be passed to our t.co link shortener as described in the API documentation.

We’ve answered the original question here, so I’m not sure what else we can do to assist you on this thread.


Yeah, I understand. But yours politic isn’t very useful. Guys, your posts have only 140 chars, not 14k chars. Why facebook set the rules regarding what is or is not permissible as a domain name, and other services too? But anyway, thanks for your time and good luck!