URGENT: BUG? .com.se domain not correctly parsed with bitly Tweet Images

Support / help / discussion forum for twitter bot
Post Reply
bitcoin
Posts: 924
Joined: Tue Jul 04, 2017 1:25 am

URGENT: BUG? .com.se domain not correctly parsed with bitly Tweet Images

Post by bitcoin »

Action Tweet Images: input #file:c:\path\tweets.txt#

Input tweet randomized =

Code: Select all

Not many #crypto communities start with a 29M people userbase.<br>@BitDegree_ORG does with #Hostinger + #000webhosting ((bitly-rand)https://www.bitdegree.org/en/token)
Which gives this tweet:

Code: Select all

Starting: 23/10/2017 22:07 PM
Posting tweet: 0/43
Attempt: (1) Posting tweet: 
Using account: MyAccount
Posting: 1836038388 to MyAccount
PostTweet :  MyAccount
Posting: 1 images
Post: C:\Users\Bad Robot\OneDrive\TwitterDub\DATA\bitdegree\Images\FireShot Capture 56 -  - https___www.bitdegree.org_white-paper.pdf.png
Process image: C:\Users\Bad Robot\OneDrive\TwitterDub\DATA\bitdegree\Images\FireShot Capture 56 -  - https___www.bitdegree.org_white-paper.pdf.png
Preprocess image: FireShot Capture 56 -  - https___www.bitdegree.org_white-paper.pdf.png
Add image to tweet: FireShot Capture 56 -  - https___www.bitdegree.org_white-paper.pdf.png using tmp path: C:\Users\Bad Robot\AppData\Local\Temp\uz7f8olbHH48hnQl.png
Added image to tweet: FireShot Capture 56 -  - https___www.bitdegree.org_white-paper.pdf.png
PreTokens: Not many #crypto communities start with a 29M people userbase.<br>@BitDegree_ORG does with #Hostinger + #000webhosting ((bitly-rand)https://www.bitdegree.org/en/token)
PostTokens: Not many #crypto communities start with a 29M people userbase.<br>@BitDegree_ORG does with #Hostinger + #000webhosting https://btc.com.se/2yDKZx5
Max length: 140
Checking tweet length: max: 140 : tweet: Not many #crypto communities start with a 29M people userbase.
@BitDegree_ORG does with #Hostinger + #000webhosting https://btc.com.se/2yDKZx5
Too long: 162
Snipped to: (131): Not many #crypto communities start with a 29M people userbase.
@BitDegree_ORG does with #Hostinger + #000webhosting https://btc.com
Posting tweet: Not many #crypto communities start with a 29M people userbase.
@BitDegree_ORG does with #Hostinger + #000webhosting https://btc.com
Max length: 140
Checking tweet length: max: 140 : tweet: Not many #crypto communities start with a 29M people userbase.
@BitDegree_ORG does with #Hostinger + #000webhosting https://btc.com
Too long: 162
Snipped to: (131): Not many #crypto communities start with a 29M people userbase.
@BitDegree_ORG does with #Hostinger + #000webhosting https://btc.com
*SUCCESS: Tweet: Not many #crypto communities start with a 29M people userbase.
@BitDegree_ORG does with #Hostinger + #000webhosting… https://t.co/a9CcyxNhMs
* SUCCESS: (1) 1836038388 to MyAccount
Pausing for: 79566
The tweet indeed ends up with https://btc.com, NOT https://btc.com.se/blaah2342. It doesn't always fail though, which is the weird part : )

Log IDs:
66747
Last edited by bitcoin on Mon Oct 23, 2017 8:36 pm, edited 1 time in total.
bitcoin
Posts: 924
Joined: Tue Jul 04, 2017 1:25 am

Re: URGENT: BUG? .com.se domain not correctly parsed with bitly Tweet Images

Post by bitcoin »

Also sent you an email with private information so you have a few examples of tweets that already went out...

Email subject: extra information for URGENT incorrect handling or URLs with bitly (but not always)
User avatar
martin@rootjazz
Site Admin
Posts: 34631
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: URGENT: BUG? .com.se domain not correctly parsed with bitly Tweet Images

Post by martin@rootjazz »

The issue is caused by trying to reduce the length.

If your tweet ended "this is the end of my tweeet.This.new.sentence"

Then the program needs to split word barriers on the "."

As "." is a valid word boundary your issue occurs. A sentence should end with a fullstop . space then the word "end sentence. New sentence" but it is not unheard of: "end sentence.New sentence" or "end sentence.new sentence"


So am not sure what can be done. Just don't make tweets too big that end with a link :)
bitcoin
Posts: 924
Joined: Tue Jul 04, 2017 1:25 am

Re: URGENT: BUG? .com.se domain not correctly parsed with bitly Tweet Images

Post by bitcoin »

I'd never write two words and a dot without a space in it... Never.do.I write like this. I *hate* and detest it even! ;p People that write that way should feel bad. All I'm guilty of is having a domain with two 'country' extensions.

Parsing "what is an URL" is not evident. I even wrote a shell script configuring my university's unix domain servers long long ago and it became complex quickly ;-)

Yet, I found this: https://mathiasbynens.be/demo/url-regex

Maybe there are some libraries or tools you could use?

Also see https://www.npmjs.com/package/url-parse ?
Post Reply