Mastodon Social Network Analysis with Go: Followers, Following, and Mutual Connections. {SocialTestCode00} + [Sample code]

I recent starting using mastodon as my primary means of social media. After researching ActivityPub and looking into other technical aspects i became really interested in the Fediverse and the different types of data available. I wrote a simple GoLang program as an exercise and to check out the state of development for the platform. I’ve previously wrote simple python data harvesters for for twitter but due to its current ownership situation I don’t believe I’ll be doing much work on it any time soon. I also gravitated to mastodon because is open source. This simple program outputs 3 lists, a mastodon account’s Followers, Following, and Mutuals. if you want to learn about some of my pit falls and what i learned you can visit the github repo or keep reading.

the Go programming language mascot

Who might uses this short program?
Anyone interested in social media or data. This program outputs an accounts Followers, Following, and Mutuals. These lists are just the tip of available data that can be used for any sort of social media analytics.

What did I learn about mastodon/goLang from writing this short program?
Mastodon and the fediverse are extremely customizable allowing users to fully curate their feeds and experiences. One of the pillars of the federated social space is that the user controls their data. they can delete it or move to a different server. Want a different timeline layout or algorithm? Just download one of many different clients with different styles.

I’ve written a few GoLang programs before but not in the last year or so. I know programming languages change so I was interested to see what’s new. When I first started writing GoLang there was no notion of context and file directories also had fewer automatically generated support files.

What problem or challenge was I trying to solve?
I wanted to see what was new or different when writing a basic GoLang program. I also wanted to learn more about mastodon and the fediverse. During the development of the program i ran into various issues that required me to read the source code for the go-mastodon repository hosted on github and the mastodon api docs.

What tools, frameworks, or technologies did I use — and why?
I wanted to do a simple review of Mastodon, the go-mastodon (golang client), and the Go Programming Language (go version go1.19.8 linux/amd64). You might find this sample code and write up useful if your using any of these.

What obstacles or unexpected issues came up during the project?
A big gotchas with go-mastodon I ran into was figuring out how to get the full set of lists. where the defaults only return at most 80 and was impossible (to my knowledge) to turn the page via its built in pagination.

What solutions, workarounds, or best practices did I discover?
I figured out that mastodon servers also return json responses. The correct pagination was available in the https request header response. I have no specific go-mastodon tips other then you might need to manually touch the mastodon api sometimes.

the Mastodon mascot

If I had to do this project again, what would I do differently?
Maybe next time I’ll work directly with the mastodon json responses? I’m not convinced that i even needed the go-mastodon client in this code. Both my code and the go-mastodon client accesses the mastodon api, Ideally all mastodon related stuff should have went though the go-mastodon client to touch the api.

What did I learn that would help others facing similar projects?
Every software developer will give you the same advice: “docs, read them often and early”. The official docs for mastodon give me my eureka moment this time but whenever I got stuck i reviewed the docs or read the source for go-mastodon. It not only helps you understand the step your taking to debug but it also immerses you in the code to help you understand how the parts work together.

Are there any reusable templates, code snippets, or techniques worth sharing?
This project is a great set of sample code on how-to work with go-mastodon. In the original published version of this code I made minimum effort to be efficient or write super clean code, comments, and appropriate variable names, I just hacked away. I might clean some things up as time goes by, check git. Pay attention to how the following/follower lists are returned.

How does this project fit into broader industry trends or best practices?
The social media landscape is changing. the fediverse will have a ton of new opportunities for collecting meaningful bits of data to help grow your audience or brand. With the old walled gardens of social media coming down knowing how to analyze data on the fediverse (or any other social media network) could be beneficial for things such as pr, business analytics, or customer service. Best practices suggest keeping an eye on any thing that can effect socials.

What resources (articles, videos, libraries) helped me the most?
Here some some of the links and docs I used.

Mastodon Docs
Mastodon Wiki
GoLang Docs
GoLang Wiki
go-mastodon on github

What’s the next step or future plan for this project (or similar ones)?
What’s Next? Working with the go-mastodon package, any number of social media data projects and automation can be done. Auto Unfollow, Add to List, Etc…

I’ll also be updating/improving the code and comments if need, please refer to the git comments to review changes. You can ask questions on this page or on the git repo.

What would you have done differently? Drop your ideas in the comments!

A Basic Introduction to Using Windows Terminal and RDP for Remote Access

Windows Terminal is a terminal emulator for Windows that provides access to command-line tools, shells, and scripts. It is a modern, feature-rich terminal program that allows users to access a variety of command-line environments in a single, customizable interface.

Remote Desktop Protocol (RDP) is a Microsoft protocol that allows users to remotely access and control another computer over a network connection. Windows Terminal can be used to connect to a remote computer using RDP by running the mstsc command followed by the IP address or hostname of the remote computer.

For Example, a simple connection to a server located at “ip_address”:

mstsc /v:<ip_address>

This will open the Remote Desktop Connection client, which will prompt you to enter your credentials and connect to the remote computer. Once connected, you can use the terminal window to run commands on the remote computer as if you were physically sitting in front of it.

RDP is commonly used by businesses and organizations to allow employees to remotely access company resources, such as servers and applications, from their own devices. It is also useful for IT administrators who need to remotely troubleshoot and manage systems and networks.

Tips from an SEO Specialist: Avoid Mistakes & Improve Rankings

In the ever-changing world of digital marketing, mastering SEO is crucial for any website’s success. Whether you’re a seasoned professional or just starting out, understanding the intricacies of search engine optimization can make or break your businesses online presence. Lets dive into 5 essential questions that will help you uncover expert insights for optimizing your website, particularly if you’re targeting competitive industries or local markets like Los Angeles or even California as a whole. These questions and answers will help you avoid common pitfalls, improve your businesse’s ranking, and ensure you’re staying ahead of the curve.

Continue reading “Tips from an SEO Specialist: Avoid Mistakes & Improve Rankings”

Case Study: Inca Trail Terpenes (www.IncaTrailTerpenes.com)

Difficulties of Cannabis Adjacent Businesses

An online business that’s cannabis adjacent faces a number of difficulties, including legal and financial challenges. For example, cannabis is still illegal under federal law, which makes it difficult for businesses to access traditional banking services, such as loans and credit lines. Additionally, many online platforms, such as social media and e-commerce sites, have strict policies against cannabis-related content, which can make it difficult for businesses to promote and sell their products. Furthermore, cannabis-related businesses also face strict regulations, including strict labelling and packaging requirements, which can be costly and time-consuming to comply with. These challenges make it difficult for cannabis-adjacent businesses to operate and grow online, but with the legalization of cannabis in many states, many online businesses are finding ways to navigate these challenges.

I was able to help Inca Trail Terpenes solve some of their most difficult problems such as payments, branding, and webstore functionality and standards.

Continue reading “Case Study: Inca Trail Terpenes (www.IncaTrailTerpenes.com)”

Blockchain {Code, Content, Community} for Everyone.

Via.Eth is an Ethereum Code, Content, and Community project. I write and provide open source tools and resources for individuals and organizations looking to incorporate smart contracts and decentralization into their online and in person operations.

  • Code
    • PayViaEth (Alpha) – A non-custodial Ethereum WordPress/Woocommerce Payment Plugin.
    • ENS Work – A set of research and smart contracts to handle different uses for the ENS. (Preliminary Research)
    • NFT Work – A set of research and smart contracts to handle different uses for NFTs. (Preliminary Research)
  • Content
    • ViaEth.io – An Ethereum Code, Content, and Community website. The main website for this project. This includes writing(research and opinions), art(memes and culture), and general commentary on the overall crypto ecosystem. (In Progress)
  • Community
    • ViaEth.io/community – Community Forums (Support, Job Board, Bad Actors, Discussion, Etc) (In Progress)
    • Eth Dev Community – Open Source dev community based around the via.eth code and projects. (github, gitcoin, reddit, etc) (In Progress)