Skip to content →

Say hello to the Social Media Scripting Framework!

It’s been a while since my last post. And there has been a reason for it, actually. I’ve been working on a new project, the Social Media Scripting Framework: a PowerShell-based environment that abstracts the complexities of modern Social Media Channels from the PowerShell command-line.

There is not question that Social Media Technologies have opened the door, not only to new ways of interaction and relationship, but also to new ways to evaluate and measure them. However, after looking at the current ecosystem of tools and solutions for a while, I’ve observed that many of them, and sometimes all of them, follow similar structural patterns. For example:

  • Form factor: SaaS delivered through the web. This, actually, is a very convenient way to provide a service while hiding the complexities to the consumer. But, unfortunately, this virtue is at the same time the main drawback. More often than not, our SaaS provider only focuses on a discrete set of functionalities and forces us to look somewhere else to fill in the gaps. At the end of the day, we end up with a collection of web services that we try to “orchestrate” by means of some sort of “digital craftsmanship”.
  • Strong focus on data aggregation. That’s perfect. In fact, when you have to deal with huge amounts of information this is a must. However, once the more immediate information needs have been covered, new sophisticated derivatives emerge based on what we have just learned. Suddenly, our information demands require us to analyze a particular subgroup in detail, compare different data sets, drill-down to the actual details, incorporate additional channels or data sources (excel spreadsheets, information from our corporate CRM or ERP systems, ), etc. Here, then, is when we learn the real meaning of “data captivity”.
  • Diverse catalog of data sources and proprietary measurement methodologies. It’s a fact that not everyone covers every forum, every blog, every community, every industry, every language or every country. It is also true that the diverse nature of some digital channels makes it difficult to have a standard set of metrics that are always measured, aggregated, segmented and calculated the same way. This makes it difficult to switch from service providers or mix data coming from some of them. But, unfortunately, the responsibility of information delivery and coherence is always ours as information consumers.  Isn’t it?
  • Partial automation or coverage of the “Social Media Value Delivery Process”. Many of these SaaS services focus on doing one thing really well. Consequently, they may, for example, automate data collection, processing and information delivery (through some sort of web dashboard or report) for the data sources under their scope. However, they may not help us with the planning and preparation needed so that the information can be captured with a reasonable degree of reliability (i.e. building URLs for track & trace purposes).

Of course, this is neither an exclusive nor an exhaustive list of patterns. Additionally, we can’t forget that they will obviously change as the marketplace improves, matures and evolves. However, this volatile context opens the door to experimentation with different approaches. And the reason is simple, at the end of the day we all have the need to address these problems because Social Media is here to stay.

One of these new approaches is the Social Media Scripting Framework. The aim of this project is to explore the possibilities of a new ‘form factor' for consuming and exploiting ‘social content' and ‘social relationships' in a decentralized and cloud-independent way.

This Framework is not for software developers, although they could actually enjoy it too. In fact, it provides easy to learn abstractions and constructs so that any user (arguably, ‘power user') can play with the ‘Social Universe' and connect it with his/her information store of choice in a convenient way. In other words, what if we could interact with it like we do with a regular database? What if we could have a “language” like SQL to consume those services?

PowerShell for Social Media purposes … Seriously?

It might sound counterintuitive that something that was born mainly as a system administration tool could also be useful for Social Media, but, actually, it is. Let me share with you the main reasons I’ve found to support this decision:

  1. PowerShell is free. In other words, the barriers of entry are very low. Unfortunately, you still have to learn PowerShell. However, I expect that most people will consume pre-canned recipes the same way many system administrators do.
  2. PowerShell is present on every Windows machine. Even Windows RT has PowerShell on the Microsoft Surface Tablet. Once again, low barriers of entry.
  3. PowerShell is an integral piece of the Microsoft Common Engineering Criteria, which means that it is, and it will be, a stable component to build upon.
  4. There is a strong supporting community around PowerShell and, additionally, all the ones addressing .NET topics can help too.
  5. From a technological point of view, PowerShell provides what’s necessary to build and maintain this project. But, more importantly, are its strong interconnection capabilities with almost any technology domain: web, databases, applications, etc.
  6. One of the design principles of this language is supporting both “canonical development” and “quick and dirty recipes”. This is a must in the System Administration world and, interestingly, it matches perfectly with the volatility that we experience in Social Media environments every day.
  7. Last but not least, after playing with this project for a while, I think that it also provides a good environment to develop Social Media activities.

You might think that I am crazy if I think that a regular user can face a command line without freaking out … Ok, you might be right. It might not work for everyone, but I am sure it will do for some people and, eventually, to many. Just look around you and identify the nearest “Office Ninja”. We all know one: regular people that master Excel functions, Word macros or Access forms to incredible degrees even though they are not “techies”.

The fact is that they have become “Office Ninjas” by own interest or due to the conditions of their own duties. Therefore and likewise, “PowerShell Ninjas” could emerge if the right conditions are met. Wouldn’t it be nice to see the birth of this new “species”? ;-).

Anyway, debates aside, I think we can agree that these technological foundations are reasonably solid and capable to address the objectives of this project and to support whatever investments you might do in it.

Use cases

So, regardless of what we can think in the future, I’ve found that the Social Media Scripting Framework can support, at least, the following scenarios:

  • templating and timeline copy generation.
  • detailed targeting and segmentation.
  • content broadcasting.
  • data collection from social media channels.
  • data set analysis.
  • integrating diverse and heterogeneous data sources and destinations.
  • complex alerting/monitoring rules.
  • prospect identification.
  • activity delegation and general purpose automation.

As you can see, all of them contribute to some degree in one or more stages of the Social Media Value Delivery Process. Hopefully, this contribution will be stronger as this product grows and matures …


Real life examples …

Over the following weeks I intend to publish different posts where you will see different use cases more in detail. However, I would like to show you some examples so that you can make up your mind of what you can do with the Social Media Scripting Framework.

Playing with Twitter …

Filtering your followers …

  >> SMSC [1] > $followers = Get-TwitterFollowers cveira
  >> SMSC [1] > $followers | select -first 10 | Format-Table screen_name, description –autoSize

screen_name    description
-----------    -----------
RebeccaJozwiak Senior Editor and Analyst at The Bloor Group and Producer of Federal Spending. Philologist and Rock Star at heart.
ReshefE        Serial entrepreneur. Founded Sanctum (acquired by IBM), Skybox Security, Blue Security, Collactive.
ffrechina      Software Engineer, Researcher in Computer Science, and Speaker. A #NodeJS lover & Scalable Web expert. Teaching and advising about ...
GrowMap        Sharing actionable strategies so YOU can grow your business, blog or cause. Cross our path with quality content and we'll share it ...
tommasterman   VP of Business Development for SportsData, a leading sports data and editorial provider.
letsBsocial    B6 Sales Management Services LLC. is a leading full-service sales management firm accelerating profitable growth, brand recognition...
PainPoint      Connecting Industry Problem Solvers. Use #painpoint and state your business or tech problem(s). I will RT if it fits our audience: ...
whymicrosoft   Insight on Microsoft solutions which drive productivity for people and their organizations. Join in a conversation on how Microsoft...
adefuros       Apasionado de las TIC, la música y el deporte. Durante el último año vivo en las nubes.'

Identifying your VIP followers …

  >> SMSC [1] > $followers | where { $_.description -match " VP|manager|CIO|CTO|CEO|CMO|COO|director|chairman" } | measure

Count    : 56
Average  :
Sum      :
Maximum  :
Minimum  :
Property :

Selecting relevant tweets …

 >> SMSC [1] > $tweets = Get-TweetsFromUser cveira -results 250 -quick
 >> SMSC [1] > $tweets | sort retweet_count -descending | select * -first 10 | format-table retweet_count, text -autoSize

retweet_count text
------------- ----
           44 RT @TechCrunch: Backed Or Whacked: Kids Projects Put The 'Fun' In Crowdfunding by @rossrubin
            2 RT @innoFPinheiro: Weekend Tip1 for #InnovationEOI students @eoi:  "The secret structure of #greattalks " @Nanc...
            1 A must read: MT "Why @SpiderOak doesn't de-duplicate data across users:" #cloud #security #storage #fw
            1 Connector Plus for your #Facebook and #Twitter data #tableau #BigData
            1 Interesting: Windows PowerShell: Make the second hop @
            1 "It's not that I'm so smart; it's just that I stay with problems longer."
            1 "Education is the most powerful weapon which you can use to change the world."
            1 Interesting: – Free Screen Sharing and Online Meetings @ #cloud
            1 +1 RT @datacenter: #Facebook Tests Immersion #Cooling: Dunks #servers in mineral oil, runs them to 110 degrees F.
            1 “Education is the most powerful weapon which you can use to change the world.”

Exploiting Facebook …

Selecting relevant posts …

  >> SMSC [1] > $FBPosts = Get-FBTimeLine -connection $FBConnection
  >> SMSC [1] > $TimeLine = Normalize-FBTimeLine $FBPosts -IncludeAll

  >> SMSC [1] > $TimeLine | where { $_.audience_count -gt 5000 } | measure

Count    : 183
Average  :
Sum      :
Maximum  :
Minimum  :
Property :

Analyzing the TimeLine …

  >> SMSC [1] > $TimeLine | Analyze-FBPosts | select * -first 10 | format-table –autoSize

PostId                          LikesCount AudienceCount CommentsCount SharesCount
------                          ---------- ------------- ------------- -----------
XXXXXXXXXXXXXXX_325174344254254          7          1578             0           2
XXXXXXXXXXXXXXX_540731369279068         11          1778             0           0
XXXXXXXXXXXXXXX_515168995181621          2          1810             0           0
XXXXXXXXXXXXXXX_515164158515438          9          1945             0           0
XXXXXXXXXXXXXXX_515163128515541         20          3988             3           2
XXXXXXXXXXXXXXX_512722558759598          6          3664             0           0
XXXXXXXXXXXXXXX_509362115762309          3          5808             1           0
XXXXXXXXXXXXXXX_506786392686548         17          7439             3           0
XXXXXXXXXXXXXXX_309732515810548          7          7542             1           0
XXXXXXXXXXXXXXX_506175539414300         13          7720             1           0

Identifying prospects …

  >> SMSC [1] > $TimeLine | Analyze-FBTimeLineProspects | sort Likes, Comments -descending | select -first 10 | format-table -autoSize

Likes Name                      Comments
----- ----                      --------
   38 Sarang XXXXXXXX                  0
   26 Arwin XXXXXX                     0
   21 Verenice XXXXXXXXXXXXXXXX        0
   19 Prolay XXXXXXXXX                 0
   17 Sidd XXXXXX                      0
   16 Vijay XXXXXXXXXXXX               0
   15 Ashish XXXXXX                    0
   13 Abhishek XXXXXXXXXXX             0
   12 Martin XXXXXXXXX                 0
   12 Shyam XXXXXX                     0

Working with Excel …

Opening an Excel workbook …

  >> SMSC [1] > $excel = New-ExcelInstance
  >> SMSC [1] > $book = Open-ExcelFile -instance $excel -file .\campaign.xlsx

  >> SMSC [1] > $CampaignSheetId = Get-ExcelSheetIdByName -book $book -name 'campaign'
  >> SMSC [1] > $CampaignDataSource = Get-ExcelSheet -book $book -id $CampaignSheetId

  >> SMSC [1] > $CampaignInfoSchema = Get-ExcelHeaders -sheet $CampaignDataSource

Loading our business dataset …

  >> SMSC [1] > $campaign = Load-ExcelDataSet -sheet $CampaignDataSource -schema $CampaignInfoSchema

Merging/Updating a dataset with a normalized TimeLine …

  >> SMSC [1] > $UpdatedCampaign = Update-DataSet $campaign -with $FBTimeLine -using $MappingRules

Saving results …

  >> SMSC [1] > Save-ExcelDataSet -DataSet $UpdatedCampaign -sheet $CampaignDataSource -schema $CampaignInfoSchema
  >> SMSC [1] > Save-ExcelFile -book $book
  >> SMSC [1] > Close-ExcelFile -instance $excel -book $book


As I’ve said before, the aim of this project is to explore the possibilities of a new ‘form factor' for exploiting your ‘Social Universe' in a decentralized and cloud-independent way (which is funny, coming from a cloud advocate like me! ;-P).

I would like to highlight that this is just a first step, a proof-of-concept, a first implementation that, hopefully, can help visualize this idea.

The Social Media Scripting Framework is far from complete. It is meant to be a journey that I would like to share with you. And that’s exactly the reason why this is an Open Source Project. So, if you want to contribute to this project, just let me know! :D.

I wish that, at least, you have found this project interesting. In fact, I would love it if you try it and share it because your comments and feedback are key for the future of this framework.

Published in Architecture Automation Projects Social Media Software Engineering


Creative Commons License
Except where otherwise noted, ThinkInBig by Carlos Veira Lorenzo is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.