Tag Archives: Useful Resources

Tweet Cruncher

I have a Social Media project on the go (waves at https://twitter.com/librarytrustees) that is going to involve tweeting sections of existing documents.

I really hate counting characters. So I decided it was time to make myself a tool for the job.

Original Document and Result after Tweet Cruncher is run on the selected text
Original Document and Result after Tweet Cruncher is run on the selected text

You can see above what I have; the selected area of the original document is highlighted in varying colours, corresponding to the resulting text broken up into tweets. Additionally, I have inserted my chosen hashtag and a count of the sequence of tweets.

Dialog box for Tweet Cruncher
Tweet Cruncher Dialog

The length of the tweets and the Hashtag are entered in a dialog box when the Tweet Cruncher runs. This information is saved with the document, for consistency with subsequent tweets. The Tweets are not exactly the tweet length; I’ve added a bit of code to “round off” each tweet to whole words. The hashtag and sequence count are additional to the length.

And realistically, there will still be editing for content and meaning. Nevertheless, this tool should save me a ton of counting and get the project going faster.

Sub BreakIntoTweets()
Dim IntSelection As Integer
Dim IntPostNumb As Integer
Dim IntPostCount As Integer
Dim IntCharCount As Integer
Dim IntTweetLength As Integer
Dim rngSelectedRange As Word.Range
Dim strPostText As String
Dim intColourPick As Integer
Dim docNewDoc As Word.Document
Dim docWorkingDoc As Word.Document
Dim strPropertyName As String
Dim strHashTag As String
Dim blnWord As Boolean
Dim intActualLength As Integer

Dim arrColourOptions As Variant
arrColourOptions = Array(wdBrightGreen, wdPink, wdTurquoise, wdYellow)
   
Set docWorkingDoc = ActiveDocument
strPropertyName = "HashTag"
strHashTag = frmStartCrunchingTweets.txtHashTag
docWorkingDoc.CustomDocumentProperties(strPropertyName) = strHashTag
IntTweetLength = frmStartCrunchingTweets.txtTweetLength
Set rngSelectedRange = Selection.Range
MsgBox rngSelectedRange.Characters.Count & " characters are selected. Including Paragraph Marks"
IntSelection = rngSelectedRange.Characters.Count
IntPostNumb = IntSelection / IntTweetLength
MsgBox IntPostNumb

rngSelectedRange.Characters(1).Select
IntCharCount = 1
Documents.Add DocumentType:=wdNewBlankDocument
Set docNewDoc = ActiveDocument
docWorkingDoc.Activate
For IntPostCount = 1 To IntPostNumb
    Selection.MoveRight unit:=wdCharacter, Count:=IntTweetLength - 1, Extend:=wdExtend
    If (Right(Selection.Text, 1) <> " ") Then blnWord = True ' extend to word
    If (Right(Selection.Text, 1) <> ".") Then blnWord = True
    If (Right(Selection.Text, 1) <> "?") Then blnWord = True
    If (Right(Selection.Text, 1) <> vbCr) Then blnWord = True
    If (Right(Selection.Text, 1) <> "!") Then blnWord = True
    If blnWord = True Then
        Selection.MoveRight unit:=wdWord, Count:=1, Extend:=wdExtend
        intActualLength = Selection.Characters.Count
    Else
        intActualLength = IntTweetLength
    End If
    blnWord = False
    strPostText = Selection.Text & frmStartCrunchingTweets.txtHashTag & " " & IntPostCount & "/" & IntPostNumb
    'get rid of any hard returns
    strPostText = Replace(strPostText, vbCr, " ")
    docNewDoc.Activate
    Selection.TypeText (strPostText) & vbCr
    docWorkingDoc.Activate
    intColourPick = IntPostCount - (4 * Int(IntPostCount \ 4)) 'note this is why no base 1 option for array here, also \ means different than / (truncation function)
    Selection.Range.HighlightColorIndex = arrColourOptions(intColourPick)
    IntCharCount = IntCharCount + intActualLength
      On Error Resume Next
    rngSelectedRange.Characters(IntCharCount).Select '(errors on final character of selection)
Next IntPostCount

End Sub

Update: A New Free to use Photo Site

I just came across a new free photo site called https://unsplash.com/  if you are creating visuals for your library’s social media feed, they have great pictures of books and people reading. Perfect for combining pictures and quotes. I was inspired by the picture below:

Books Stacked Everywhere - from unsplash.com
Books Everywhere

So I headed off to the internet to find a quote that I thought was perfect for these random stacks of books.

“The old man was peering intently at the shelves. 'I'll have to admit that he's a very competent scholar.' Isn't he just a librarian?' Garion asked, 'somebody who looks after books?' That's where all the rest of scholarship starts, Garion. All the books in the world won't help you if they're just piled up in a heap.” ― David Eddings, King of the Murgos
Organization – the secret power of Librarians!

Using the tip I mentioned in this post, I combined the text and image into a picture sized for Twitter.

And then because I’d fallen down into the internet quote-hole I used another picture from unsplash and a terrific quote from the always library friendly Neil Gaiman.

“It's still National Library Week. You should be especially nice to a librarian today, or tomorrow. Sometime this week, anyway. Probably the librarians would like tea. Or chocolates. Or a reliable source of funding.” ― Neil Gaiman
We love Neil Gaiman

If you want to look back – I have a previous post on other free graphics sites.

PowerPoint: Make it Fit

I’ve mentioned it before, but PowerPoint can be a handy graphic editing tool. Especially when you want to combine pictures and text. The question is;  how do you get perfectly sized pictures every time?

Most people don’t play with the Page Setup options other than to swap their slides between a 4:3/16:9 ratio. However you can input your own custom dimensions.

Navigate to the Page Setup Dialog box
Make your own Custom Sized PowerPoint Templates

Go to the Design ribbon and open the Page Setup dialog box. The last choice in the Slides sized for drop down is Custom. Once this is selected you can input your own dimensions (within limits). To create the Twitter header photo template, I researched the dimensions of a Twitter header photo (500px by 1500px). Then I used this website to convert the pixel measurement to centimeters. The website also converts to inches, if that is your preferred measurement.

Now I can easily size my photos for Twitter! (Or Facebook, or Pinterest etc.)

 

Social Media tips – free photo resources

  • Library and Archives Canada –Image Search
  • New York Public Library  – Search Page
  • The Rijkmuseum in Amerstdam has digitized its collection. All of its works are free to use. Its’ policy “If you use our images for publication, then we request that you acknowledge the source (Rijksmuseum, Amsterdam). We would also like to receive a copy of the publication for our library.”
  • Try the Creative Commons search tool.
  • This post from Hootsuite offers a list of 20 different Free Stock Photo websites. The one I like the best is Pexels, which is where I found this posts’ featured image.
  • University of Alberta Peel Image search.