Gordon  Murray

Gordon Murray


Switch From Twitter to Mastodon

Mastodon is an open source microblogging community.

Like many people, I find social media somewhat exciting and also...a bit much. Sometimes you get deep-fried in algorithms, tracking data, and ads catered especially for you. You lack administrative control over what you want to see, especially on the old platforms many of us are used to. As usual, you must look to open source to fix the problem. And that's exactly what Mastodon, an open source microblogging community, does.

With Mastodon social, not only are you working with open source software, but everything is decentralized, which means you can pick what you want to see partly based on the instance you want to occupy. Mastodon uses separate instances, each with its own code of conduct, privacy options, and moderation policies. That means that when you join an instance, you're less likely to see the stuff you're not interested in and more likely to see messages from people who share your interests.

However, you can also interact with other instances. All Mastodon installs have the potential to be "federated" in what its users call the "fediverse."

What is the fediverse?

The fediverse is an ensemble of federated (or interconnected) servers. The word comes from the mix of "federated" and "universe." You can use this for all sorts of web publishing, from social networking to websites to file hosting. While each instance is hosted independently, they can talk to each other.

So how can I sign up for Mastodon?

First, go to Mastodon.social to sign up.

On the right-hand side of the screen, there are Sign in and Create account buttons.

or Create Account interface

(Jess Cherry, CC BY-SA 4.0)

However, because anyone can run a Mastodon server, there are many instances, and some servers are already home to a community with interests that may align with your own. As I've said, you'll have access to the whole fediverse no matter what, but it can be nice to start on a server where people already "speak your language" (that can be literal, too, because you can add a filter to find a server in your native language).

To find a server, click the Find another server button.

Signing up interface

(Jess Cherry, CC BY-SA 4.0)

When you click that button, you're brought to the Join Mastodon page, with a button to list available servers.

Getting started interface

(Jess Cherry, CC BY-SA 4.0)

As you scroll down, you can pick a topic on the left to help you find where you would like to be hosted.

Topic list

(Jess Cherry, CC BY-SA 4.0)

I'm all about open source, so let's see what we have in the technology topic.

Technology topics

(Jess Cherry, CC BY-SA 4.0)

As you can see, there's a large index with many waiting lists. In this case, it looks like Don Watkins, a fellow Opensource.com author, has chosen an instance that works for himself and our talented group. So I'll skip ahead and tell you where I'm going: There's a free open source software server known as Fosstodon, and I've chosen to sign up there so I can share my articles freely.

[ Related read Switching from Twitter to Mastodon: What sysadmins need to know ]

Here are the sign-in steps.

First, enter your information:

Steps for signing in

(Jess Cherry, CC BY-SA 4.0)

Next, you get a message about a confirmation email:

Confirmation message

(Jess Cherry, CC BY-SA 4.0)

When you get to your email, click the Verify button, and the system prompts you to confirm your login information.

This server does have an application process to join. This process isn't just for safety reasons but also for privacy. Once approved, you get this amazing email!

Welcome message

(Jess Cherry, CC BY-SA 4.0)

I kept my handle from other social media venues, so it's easy to move back and forth from one place to another and cross-post with replication and API calls.

Complete control

Now that I have a new profile, I can change preferences on what emails I receive, allowing for more control over what I see. This is a good way to give me more power over my media intake, and it's greatly appreciated. Once I click Preferences, Mastodon offers me cool appearance, language information, and many other options.

Appearance settings

(Jess Cherry, CC BY-SA 4.0)

Next, I can click notifications and limit what I see and what I get notified for, so I can opt for less noise.

Notifications settings

(Jess Cherry, CC BY-SA 4.0)

This complete control of my media without algorithmic intervention is great. You can also set up featured hashtags for what you want on your profile to follow long-term projects or allow people to find you by following those hashtags. You also have the options for filters, followers, and so much more.

Final notes

This open source social media is a great way to find your group of people and broadly interact with those in a broad universe of interests. Controlling media intake is great for some balance in your life, and you can opt-in to contributing by checking the contributor rules.

In addition to the control over your own social media experience, you also gain phone apps that work on all devices, including Toot for iPhone and Tusky for Android.

Long story short: I think we should all get ready for a new open source world of social media.

Original article source at: https://opensource.com/

#mastodon #twitter 

Switch From Twitter to Mastodon

4 Favorite key differences between Twitter and Mastodon

Mastodon is not a corporation. All of its instances are staffed and supported by each server's contributors. Here are a few other advantages.

Social media is not always sociable, and sometimes we need a sufficient impetus to change what we do and what we read. I began using Twitter as a replacement for my RSS reader in 2008, which revolutionized how I read and learned up to that point. Tweets from educators and free and open source (FOSS) advocates worldwide kept me informed and engaged in a learning network that was without equal. That's changed over the past half dozen years, and recently a change in ownership and the shaping of what I read was driven more by an algorithm than by my personal interests and choices. During a yearly meetup of correspondents and editors of Opensource.com a few years ago, Seth Kenlon suggested giving Mastodon a try. I joined Fosstodon in 2019. Fosstodon is a Mastodon instance for a community of like-minded people who enjoy free and open source software.

Mastodon vs Twitter

Change is not easy. Being a creature of habit, I stayed with my old standby even though it was becoming increasingly tiresome. The threat of its sale in the spring of 2022 invited me to reconsider Fosstodon.

1. Favorite instead of like

The Mastodon interface is similar to Twitter. Rather than "liking" a post, you "favorite" a post on Mastodon by clicking the star icon under the post content.

Favorite button

(Don Watkins, CC BY-SA 4.0)

2. Share a post

Re-sharing on my old network is a "retweet," but on Mastodon, it's a "boost." You click the double-arrow icon under the post content to boost a post.

Boost button

(Don Watkins, CC BY-SA 4.0)

3. Mastodon instances

Because anyone can run a Mastodon instance, different instances not only have unique communities (like the ones that form around specific hashtags on Twitter, but Mastodon also has hashtags). Some have a unique set of rules. For instance, unlike my former social network, there were content moderation rules on Fosstodon that seemed strict initially. I made a post unrelated to FOSS software, and my post was removed. I was told it had been removed because I'd not issued a "content warning." That irked me, so I looked for another instance and found a couple more to my liking. One was Mastodon.social, and the other Scholar.social. The former is a general server with no expectation about what you will post. The latter was an instance dedicated to academics. In all cases, there are well-enforced codes of conduct.

Each instance has rules, and while they differ slightly in the description, they clearly spell out what is and is not acceptable behavior. Fosstodon published its code of conduct, which established the rules and expectations of behavior on the site.

4. Open source social networking

If you want to run your own Mastodon instance or help develop one, you'll be happy to know that Mastodon is open source. It uses an AGPLv3 license, and its source code is available as a Git repository. The software provides a social network server that uses the ActivityPub protocol to communicate with other servers worldwide.

Mastodon is not a single site on the internet but a series of sites spanning the globe and communicating with each other. This federated network is referred to as the "fediverse." Unlike other social networks, where there's a single owner of the network, Mastodon and other ActivityPub sites are owned by anyone who runs a server.

From a user's perspective, this doesn't matter at first. You can sign up on any Mastodon instance and then connect to all other instances.

[ Related read Switching from Twitter to Mastodon: What sysadmins need to know ]

There is power to this distributed design, though. If you encounter an instance with a community producing content you'd rather not see, you can block either a single user from that instance or the whole instance.

In the past month, I've returned to Fosstodon primarily because open source is my passion. I enjoy sharing open source content on Fosstodon because the other users of Fosstodon are generally receptive to posts about free and open source software. When I have something to share that's not considered appropriate on Fosstodon, I share it on Scholar.social or Mastodon.social.

Not all instances have topics they focus on, and even those that do often use their topical interests as a guideline rather than grounds for strict removal of posts. If you have a particular interest, you might be able to find a community built around that topic, and you're likely to see that you have an instant audience. Of course, you'll still always be able to communicate with users of other instances, too.

Try Mastodon

Mastodon is not a corporation. All of its instances are staffed and supported by each server's contributors. Some instances make it easy to support them with Patreon or PayPal.

I have found the fediverse a welcoming place that brings joy back into social networking. Have you joined Mastodon? What are your takeaways? Let us know in the comments.

Original article source at: https://opensource.com/

#mastodon #twitter 

4 Favorite key differences between Twitter and Mastodon
Mahoro  Trisha

Mahoro Trisha


PHP Twitter Clone with Almost All Twitter Functionalities

Twitter Clone 

Bulit PHP Twitter Clone IN OOP style and using MYSQL Database. AJAX and Jquery for requests without reloading like Follow/unfollow, like, Search users, Show popups like comment , User lists, etc.


  • Sign in / Sign UP
  • Post Image or Normal Tweet.
  • Retweet or Qoute Tweet (You can qoute the qouted tweet).
  • Like Tweet.
  • Add Comment and reply to the comment (Nested Comments).
  • Mention User in Tweet or add hashtag to your tweet.
  • Follow/Unfollow user.
  • Get Notification when any previous action happened.
  • Change Username/Password/Email From Settings.
  • Search users by name and username.
  • Edit Profile Like: (Change :avatar/username/cover etc).

Running locally

  • Create New Database then import twitter.sql file on it.
  • go to PATH core/classes/connection.php and add your database info.
   protected static $servername = "localhost";
   protected static $db_name="twitter";
   protected static $username = "root";
   protected static $password = "";

then the project is ready to run in localhost!

đź“· UI





Tweet and Comments






Edit Account


Preview Image before Tweet


Users List (For following/likedby etc)




Download Details:

Author: aminyasser
Source Code: https://github.com/aminyasser/twitter-clone

#twitter #php 

PHP Twitter Clone with Almost All Twitter Functionalities
Nat  Grady

Nat Grady


R Package for Detecting Twitter Bots Via Machine Learning


An R package for classifying Twitter accounts as bot or not.


Uses machine learning to classify Twitter accounts as bots or not bots. The default model is 93.53% accurate when classifying bots and 95.32% accurate when classifying non-bots. The fast model is 91.78% accurate when classifying bots and 92.61% accurate when classifying non-bots.

Overall, the default model is correct 93.8% of the time.

Overall, the fast model is correct 91.9% of the time.


Install from CRAN:

## install from CRAN

Install the development version from Github:

## install remotes if not already
if (!requireNamespace("remotes", quietly = TRUE)) {

## install tweetbotornot from github

API authorization

Users must be authorized in order to interact with Twitter’s API. To setup your machine to make authorized requests, you’ll either need to be signed into Twitter and working in an interactive session of R–the browser will open asking you to authorize the rtweet client (rstats2twitter)–or you’ll need to create an app (and have a developer account) and your own API token. The latter has the benefit of (a) having sufficient permissions for write-acess and DM (direct messages) read-access levels and (b) more stability if Twitter decides to shut down [@kearneymw](https://twitter.com/kearneymw)’s access to Twitter (I try to be very responsible these days, but Twitter isn’t always friendly to academic use cases). To create an app and your own Twitter token, see these instructions provided in the rtweet package.


There’s one function tweetbotornot() (technically there’s also botornot(), but it does the same exact thing). Give it a vector of screen names or user IDs and let it go to work.

## load package

## select users
users <- c("realdonaldtrump", "netflix_bot",
  "kearneymw", "dataandme", "hadleywickham",
  "ma_salmon", "juliasilge", "tidyversetweets", 
  "American__Voter", "mothgenerator", "hrbrmstr")

## get botornot estimates
data <- tweetbotornot(users)

## arrange by prob ests
data[order(data$prob_bot), ]
#> # A tibble: 11 x 3
#>    screen_name     user_id            prob_bot
#>    <chr>           <chr>                 <dbl>
#>  1 hadleywickham   69133574            0.00754
#>  2 realDonaldTrump 25073877            0.00995
#>  3 kearneymw       2973406683          0.0607 
#>  4 ma_salmon       2865404679          0.150  
#>  5 juliasilge      13074042            0.162  
#>  6 dataandme       3230388598          0.227  
#>  7 hrbrmstr        5685812             0.320  
#>  8 netflix_bot     1203840834          0.978  
#>  9 tidyversetweets 935569091678691328  0.997  
#> 10 mothgenerator   3277928935          0.998  
#> 11 American__Voter 829792389925597184  1.000  

Integration with rtweet

The botornot() function also accepts data returned by rtweet functions.

## get most recent 100 tweets from each user
tmls <- get_timelines(users, n = 100)

## pass the returned data to botornot()
data <- botornot(tmls)

## arrange by prob ests
data[order(data$prob_bot), ]
#> # A tibble: 11 x 3
#>    screen_name     user_id            prob_bot
#>    <chr>           <chr>                 <dbl>
#>  1 hadleywickham   69133574            0.00754
#>  2 realDonaldTrump 25073877            0.00995
#>  3 kearneymw       2973406683          0.0607 
#>  4 ma_salmon       2865404679          0.150  
#>  5 juliasilge      13074042            0.162  
#>  6 dataandme       3230388598          0.227  
#>  7 hrbrmstr        5685812             0.320  
#>  8 netflix_bot     1203840834          0.978  
#>  9 tidyversetweets 935569091678691328  0.997  
#> 10 mothgenerator   3277928935          0.998  
#> 11 American__Voter 829792389925597184  1.000  

fast = TRUE

The default [gradient boosted] model uses both users-level (bio, location, number of followers and friends, etc.) and tweets-level (number of hashtags, mentions, capital letters, etc. in a user’s most recent 100 tweets) data to estimate the probability that users are bots. For larger data sets, this method can be quite slow. Due to Twitter’s REST API rate limits, users are limited to only 180 estimates per every 15 minutes.

To maximize the number of estimates per 15 minutes (at the cost of being less accurate), use the fast = TRUE argument. This method uses only users-level data, which increases the maximum number of estimates per 15 minutes to 90,000! Due to losses in accuracy, this method should be used with caution!

## get botornot estimates
data <- botornot(users, fast = TRUE)

## arrange by prob ests
data[order(data$prob_bot), ]
#> # A tibble: 11 x 3
#>    screen_name     user_id            prob_bot
#>    <chr>           <chr>                 <dbl>
#>  1 hadleywickham   69133574            0.00185
#>  2 kearneymw       2973406683          0.0415 
#>  3 ma_salmon       2865404679          0.0661 
#>  4 dataandme       3230388598          0.0965 
#>  5 juliasilge      13074042            0.112  
#>  6 hrbrmstr        5685812             0.121  
#>  7 realDonaldTrump 25073877            0.368  
#>  8 netflix_bot     1203840834          0.978  
#>  9 tidyversetweets 935569091678691328  0.998  
#> 10 mothgenerator   3277928935          0.999  
#> 11 American__Voter 829792389925597184  0.999  


In order to avoid confusion, the package was renamed from “botrnot” to “tweetbotornot” in June 2018. This package should not be confused with the botornot application.

Download Details:

Author: mkearney
Source Code: https://github.com/mkearney/tweetbotornot 
License: Unknown, MIT licenses found

#r #machinelearning #twitter #rstats 

R Package for Detecting Twitter Bots Via Machine Learning
Adam Daniels

Adam Daniels


How to Create a Twitter Bot using Python

Learn how to create a Twitter Bot using Python 3, RandomWords, Tweepy, PyDictionary, Random, and much much more! Learn the basics of the Twitter API and Python without any prior knowledge required!

In this tutorial, I will be teaching you how to create a Twitter Bot using Python 3, RandomWords, Tweepy, PyDictionary, Random, and much much more!  The first four sections will teach you how to use each of the libraries separately, with the last combining everything to top off this sundae!  We will be programmatically posting these tweets instead of controlling the mouse and other methods of creating bots!  Therefore, the python file can be running while you are playing a video game!  I hope that you enjoy watching this course as much as I had making it!

What you’ll learn:

  •        Build a Twitter Bot
  •        Basic Use of the Twitter API
  •        PyDictionary Library (Python)
  •        RandomWords Library (Python)
  •        Navigating Dictionary Types in Python 3

Are there any course requirements or prerequisites?

  •        Basic Knowledge of Python 3

Who this course is for:

  •        Beginner-Expert Python Programmers

#python #twitter 

How to Create a Twitter Bot using Python

Seotools: SEO tools for Laravel

SEOTools - SEO Tools for Laravel and Lumen

SEOTools is a package for Laravel 5.8+ and Lumen that provides helpers for some common SEO techniques.



1 - Dependency

The first step is using composer to install the package and automatically update your composer.json file, you can do this by running:

composer require artesaos/seotools

Note: If you are using Laravel 5.5, the steps 2 and 3, for providers and aliases, are unnecessaries. SEOTools supports Laravel new Package Discovery.

2 - Provider

You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your config/app.php file adding the following code at the end of your 'providers' section:



return [
    // ...
    'providers' => [
        // ...
    // ...


Go to /bootstrap/app.php file and add this line:

// ...

$app = new Laravel\Lumen\Application(

// ...


// ...

return $app;

3 - Facades

Note: facades are not supported in Lumen.

You may get access to the SEO tool services using following facades:

  • Artesaos\SEOTools\Facades\SEOMeta
  • Artesaos\SEOTools\Facades\OpenGraph
  • Artesaos\SEOTools\Facades\TwitterCard
  • Artesaos\SEOTools\Facades\JsonLd
  • Artesaos\SEOTools\Facades\JsonLdMulti
  • Artesaos\SEOTools\Facades\SEOTools

You can setup a short-version aliases for these facades in your config/app.php file. For example:


return [
    // ...
    'aliases' => [
        'SEOMeta'       => Artesaos\SEOTools\Facades\SEOMeta::class,
        'OpenGraph'     => Artesaos\SEOTools\Facades\OpenGraph::class,
        'Twitter'       => Artesaos\SEOTools\Facades\TwitterCard::class,
        'JsonLd'        => Artesaos\SEOTools\Facades\JsonLd::class,
        'JsonLdMulti'   => Artesaos\SEOTools\Facades\JsonLdMulti::class,
        // or
        'SEO' => Artesaos\SEOTools\Facades\SEOTools::class,
        // ...
    // ...

4 Configuration

Publish config

In your terminal type

php artisan vendor:publish


php artisan vendor:publish --provider="Artesaos\SEOTools\Providers\SEOToolsServiceProvider"

Lumen does not support this command, for it you should copy the file src/resources/config/seotools.php to config/seotools.php of your project

In seotools.php configuration file you can determine the properties of the default values and some behaviors.


  • meta
    • defaults - What values are displayed if not specified any value for the page display. If the value is false, nothing is displayed.
    • webmaster - Are the settings of tags values for major webmaster tools. If you are null nothing is displayed.
  • opengraph
    • defaults - Are the properties that will always be displayed and when no other value is set instead. You can add additional tags that are not included in the original configuration file.
  • twitter
    • defaults - Are the properties that will always be displayed and when no other value is set instead. You can add additional tags that are not included in the original configuration file.
  • json-ld
    • defaults - Are the properties that will always be displayed and when no other value is set instead. You can add additional tags that are not included in the original configuration file.


Lumen Usage

Note: facades are not supported in Lumen.


$seotools = app('seotools');
$metatags = app('seotools.metatags');
$twitter = app('seotools.twitter');
$opengraph = app('seotools.opengraph');
$jsonld = app('seotools.json-ld');
$jsonldMulti = app('seotools.json-ld-multi');

// The behavior is the same as the facade

echo app('seotools')->generate();

Meta tags Generator

With SEOMeta you can create meta tags to the head

Opengraph tags Generator

With OpenGraph you can create OpenGraph tags to the head

Twitter for Twitter Cards tags Generator

With Twitter you can create OpenGraph tags to the head

In your controller


namespace App\Http\Controllers;

use Artesaos\SEOTools\Facades\SEOMeta;
use Artesaos\SEOTools\Facades\OpenGraph;
use Artesaos\SEOTools\Facades\TwitterCard;
use Artesaos\SEOTools\Facades\JsonLd;
// OR with multi
use Artesaos\SEOTools\Facades\JsonLdMulti;

// OR
use Artesaos\SEOTools\Facades\SEOTools;

class CommomController extends Controller
    public function index()
        SEOMeta::setDescription('This is my page description');

        OpenGraph::setDescription('This is my page description');
        OpenGraph::addProperty('type', 'articles');


        JsonLd::setDescription('This is my page description');

        // OR

        SEOTools::setDescription('This is my page description');
        SEOTools::opengraph()->addProperty('type', 'articles');

        $posts = Post::all();

        return view('myindex', compact('posts'));

    public function show($id)
        $post = Post::find($id);

        SEOMeta::addMeta('article:published_time', $post->published_date->toW3CString(), 'property');
        SEOMeta::addMeta('article:section', $post->category, 'property');
        SEOMeta::addKeyword(['key1', 'key2', 'key3']);

        OpenGraph::addProperty('type', 'article');
        OpenGraph::addProperty('locale', 'pt-br');
        OpenGraph::addProperty('locale:alternate', ['pt-pt', 'en-us']);

        OpenGraph::addImage(['url' => 'http://image.url.com/cover.jpg', 'size' => 300]);
        OpenGraph::addImage('http://image.url.com/cover.jpg', ['height' => 300, 'width' => 300]);


        // OR with multi

        if(! JsonLdMulti::isEmpty()) {
            JsonLdMulti::setTitle('Page Article - '.$post->title);

        // Namespace URI: http://ogp.me/ns/article#
        // article
            ->setDescription('Some Article')
                'published_time' => 'datetime',
                'modified_time' => 'datetime',
                'expiration_time' => 'datetime',
                'author' => 'profile / array',
                'section' => 'string',
                'tag' => 'string / array'

        // Namespace URI: http://ogp.me/ns/book#
        // book
            ->setDescription('Some Book')
                'author' => 'profile / array',
                'isbn' => 'string',
                'release_date' => 'datetime',
                'tag' => 'string / array'

        // Namespace URI: http://ogp.me/ns/profile#
        // profile
             ->setDescription('Some Person')
                'first_name' => 'string',
                'last_name' => 'string',
                'username' => 'string',
                'gender' => 'enum(male, female)'

        // Namespace URI: http://ogp.me/ns/music#
        // music.song
                'duration' => 'integer',
                'album' => 'array',
                'album:disc' => 'integer',
                'album:track' => 'integer',
                'musician' => 'array'

        // music.album
                'song' => 'music.song',
                'song:disc' => 'integer',
                'song:track' => 'integer',
                'musician' => 'profile',
                'release_date' => 'datetime'

                'song' => 'music.song',
                'song:disc' => 'integer',
                'song:track' => 'integer',
                'creator' => 'profile'

        // music.radio_station
                'creator' => 'profile'

        // Namespace URI: http://ogp.me/ns/video#
        // video.movie
                'actor' => 'profile / array',
                'actor:role' => 'string',
                'director' => 'profile /array',
                'writer' => 'profile / array',
                'duration' => 'integer',
                'release_date' => 'datetime',
                'tag' => 'string / array'

        // video.episode
                'actor' => 'profile / array',
                'actor:role' => 'string',
                'director' => 'profile /array',
                'writer' => 'profile / array',
                'duration' => 'integer',
                'release_date' => 'datetime',
                'tag' => 'string / array',
                'series' => 'video.tv_show'

        // video.tv_show
                'actor' => 'profile / array',
                'actor:role' => 'string',
                'director' => 'profile /array',
                'writer' => 'profile / array',
                'duration' => 'integer',
                'release_date' => 'datetime',
                'tag' => 'string / array'

        // video.other
                'actor' => 'profile / array',
                'actor:role' => 'string',
                'director' => 'profile /array',
                'writer' => 'profile / array',
                'duration' => 'integer',
                'release_date' => 'datetime',
                'tag' => 'string / array'

        // og:video
        OpenGraph::addVideo('http://example.com/movie.swf', [
                'secure_url' => 'https://example.com/movie.swf',
                'type' => 'application/x-shockwave-flash',
                'width' => 400,
                'height' => 300

        // og:audio
        OpenGraph::addAudio('http://example.com/sound.mp3', [
                'secure_url' => 'https://secure.example.com/sound.mp3',
                'type' => 'audio/mpeg'

        // og:place
             ->setDescription('Some Place')
                'location:latitude' => 'float',
                'location:longitude' => 'float',

        return view('myshow', compact('post'));



namespace App\Http\Controllers;

use Artesaos\SEOTools\Traits\SEOTools as SEOToolsTrait;

class CommomController extends Controller
    use SEOToolsTrait;

    public function index()
        $this->seo()->setDescription('This is my page description');
        $this->seo()->opengraph()->addProperty('type', 'articles');

        $posts = Post::all();

        return view('myindex', compact('posts'));

In Your View

Pro Tip: Pass the parameter true to get minified code and reduce filesize.

    {!! SEOMeta::generate() !!}
    {!! OpenGraph::generate() !!}
    {!! Twitter::generate() !!}
    {!! JsonLd::generate() !!}
    // OR with multi
    {!! JsonLdMulti::generate() !!}

    <!-- OR -->
    {!! SEO::generate() !!}

    <!-- MINIFIED -->
    {!! SEO::generate(true) !!}

    <!-- LUMEN -->
    {!! app('seotools')->generate() !!}

    <title>Title - Over 9000 Thousand!</title>
    <meta name='description' itemprop='description' content='description...'>
    <meta name='keywords' content='key1, key2, key3'>
    <meta property='article:published_time' content='2015-01-31T20:30:11-02:00'>
    <meta property='article:section' content='news'>

    <meta property="og:description" content="description...">
    <meta property="og:title" content="Title">
    <meta property="og:url" content="http://current.url.com">
    <meta property="og:type" content="article">
    <meta property="og:locale" content="pt-br">
    <meta property="og:locale:alternate" content="pt-pt">
    <meta property="og:locale:alternate" content="en-us">
    <meta property="og:site_name" content="name">
    <meta property="og:image" content="http://image.url.com/cover.jpg">
    <meta property="og:image" content="http://image.url.com/img1.jpg">
    <meta property="og:image" content="http://image.url.com/img2.jpg">
    <meta property="og:image" content="http://image.url.com/img3.jpg">
    <meta property="og:image:url" content="http://image.url.com/cover.jpg">
    <meta property="og:image:size" content="300">

    <meta name="twitter:card"content="summary">
    <meta name="twitter:title"content="Title">
    <meta name="twitter:site"content="@LuizVinicius73">

    <script type="application/ld+json">{"@context":"https://schema.org","@type":"Article","name":"Title - Over 9000 Thousand!"}</script>
    <!-- OR with multi -->
    <script type="application/ld+json">{"@context":"https://schema.org","@type":"Article","name":"Title - Over 9000 Thousand!"}</script>
    <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Title - Over 9000 Thousand!"}</script>




use Artesaos\SEOTools\Facades\SEOMeta;

SEOMeta::addMeta($meta, $value = null, $name = 'name');
SEOMeta::addAlternateLanguage($lang, $url);
SEOMeta::addAlternateLanguages(array $languages);

// You can chain methods
            ->addMeta($meta, $value);

// Retrieving data


API (OpenGraph)


use Artesaos\SEOTools\Facades\OpenGraph;

OpenGraph::addProperty($key, $value); // value can be string or array
OpenGraph::addImage($url); // add image url
OpenGraph::addImages($url); // add an array of url images
OpenGraph::setTitle($title); // define title
OpenGraph::setDescription($description);  // define description
OpenGraph::setUrl($url); // define url
OpenGraph::setSiteName($name); //define site_name

// You can chain methods
OpenGraph::addProperty($key, $value)

// Generate html tags

API (TwitterCard)


use Artesaos\SEOTools\Facades\TwitterCard;

TwitterCard::addValue($key, $value); // value can be string or array
TwitterCard::setType($type); // type of twitter card tag
TwitterCard::setTitle($type); // title of twitter card tag
TwitterCard::setSite($type); // site of twitter card tag
TwitterCard::setDescription($type); // description of twitter card tag
TwitterCard::setUrl($type); // url of twitter card tag
TwitterCard::setImage($url); // add image url

// You can chain methods
TwitterCard::addValue($key, $value)

// Generate html tags

API (JsonLd)


use Artesaos\SEOTools\Facades\JsonLd;

JsonLd::addValue($key, $value); // value can be string or array
JsonLd::setType($type); // type of twitter card tag
JsonLd::setTitle($type); // title of twitter card tag
JsonLd::setSite($type); // site of twitter card tag
JsonLd::setDescription($type); // description of twitter card tag
JsonLd::setUrl($type); // url of twitter card tag
JsonLd::setImage($url); // add image url

// You can chain methods
JsonLd::addValue($key, $value)

// Generate html tags

API (JsonLdMulti)


use Artesaos\SEOTools\Facades\JsonLdMulti;

JsonLdMulti::newJsonLd(); // create a new JsonLd group
JsonLdMulti::isEmpty(); // check if the current JsonLd group is empty
JsonLdMulti::select($index); // choose the JsonLd group that will be edited by the methods below
JsonLdMulti::addValue($key, $value); // value can be string or array
JsonLdMulti::setType($type); // type of twitter card tag
JsonLdMulti::setTitle($type); // title of twitter card tag
JsonLdMulti::setSite($type); // site of twitter card tag
JsonLdMulti::setDescription($type); // description of twitter card tag
JsonLdMulti::setUrl($type); // url of twitter card tag
JsonLdMulti::setImage($url); // add image url

// You can chain methods
JsonLdMulti::addValue($key, $value)
// You can add an other group
if(! JsonLdMulti::isEmpty()) {
// Generate html tags
// You will have retrieve <script content="application/ld+json"/>


Facilitates access to all the SEO Providers


use Artesaos\SEOTools\Facades\SEOTools;


SEOTools::getTitle($session = false);

Missing Features

There are many SEO-related features, which you may need for your project. While this package provides support for the basic ones, other are out of its scope. You'll have to use separate packages for their integration.


This package does not support sitemap files generation. Please consider usage one of the following packages for it:



URL Trailing Slash

This package does not handle URL consistency regardless absence or presence of the slash symbol at its end. Please consider usage one of the following packages if you need it:



Microdata Markup

This package does provide generation of the microdata HTML markup. If you need to create HTML like the following one:

<div itemscope>
 <p>My name is
  <span itemprop="name">Elizabeth</span>.</p>

you will need to handle it yourself.

Note: nowadays microdata markup is considered to be outdated. It is recommened to use JSON Linked Data instead, which is supported by this extension.


This package does not support RSS feed generation or related meta data composition. Please consider usage one of the following packages for it:

Download Details:

Author: Artesaos
Source Code: https://github.com/artesaos/seotools 
License: MIT license

#php #laravel #twitter #facade

Seotools: SEO tools for Laravel
Jane  Reid

Jane Reid


Combines Twitter Bootstrap and CodeIgniter together

CodeIgniter Bootstrap


If you're planning on just using/developing with CodeIgniter Bootstrap, don't clone the repository. Instead, use these steps to get a pre-compiled version of it.


If you plan on extending the build process, you should follow these steps. This will only work on a *nix machine and not on a Windows machine.

  • First clone this reposistory
git clone https://github.com/sjlu/CodeIgniter-Bootstrap.git
cd CodeIgniter-Bootstrap
  • Run the makefile
  • Unzip the build
unzip CodeIgniter-Bootstrap.zip


Check out the Wiki for information and CodeIgniter guides.

Bundles the following packages together.



Download Details:

Author: sjlu
Source Code: https://github.com/sjlu/CodeIgniter-Bootstrap

#bootstrap #codeigniter #twitter 

Combines Twitter Bootstrap and CodeIgniter together
Nat  Grady

Nat Grady


Rtweet: R Client for interacting with Twitter's [stream and REST] APIs


Use twitter from R. Get started by reading vignette("rtweet").


To get the current released version from CRAN:


You can install the development version of rtweet from GitHub with:

install.packages("rtweet", repos = 'https://ropensci.r-universe.dev')


All users must be authenticated to interact with Twitter’s APIs. The easiest way to authenticate is to use your personal twitter account - this will happen automatically (via a browser popup) the first time you use an rtweet function. See auth_setup_default() for details. Using your personal account is fine for casual use, but if you are trying to collect a lot of data it’s a good idea to authenticate with your own Twitter “app”. See vignette("auth", package = "rtweet") for details.


rtweet should be used in strict accordance with Twitter’s developer terms.

Search tweets or users

Search for up to 1000 tweets containing #rstats, the common hashtag used to refer to the R language, excluding retweets:

rt <- search_tweets("#rstats", n = 1000, include_rts = FALSE)

Twitter rate limits cap the number of search results returned to 18,000 every 15 minutes. To request more than that, set retryonratelimit = TRUE and rtweet will wait for rate limit resets for you.

Search for 200 users with the #rstats in their profile:

useRs <- search_users("#rstats", n = 200)

Stream tweets

Randomly sample (approximately 1%) from the live stream of all tweets:

random_stream <- stream_tweets("")

Stream all geo-located tweets from London for 60 seconds:

stream_london <- stream_tweets(location = lookup_coords("london"), timeout = 60)

Get friends and followers

Get all accounts followed by a user:

## get user IDs of accounts followed by R Foundation
R_Foundation_fds <- get_friends("_R_Foundation")

## lookup data on those accounts
R_Foundation_fds_data <- lookup_users(R_Foundation_fds$to_id)

Get all accounts following a user:

## get user IDs of accounts following R Foundation
R_Foundation_flw <- get_followers("_R_Foundation", n = 100)
R_Foundation_flw_data <- lookup_users(R_Foundation_flw$from_id)

If you want all followers, you'll need to set n = Inf and retryonratelimit = TRUE but be warned that this might take a long time.

Get timelines

Get the most recent 200 tweets from R Foundation:

## get user IDs of accounts followed by R Foundation
tmls <- get_timeline("_R_Foundation", n = 100)

Get favorites

Get the 10 most recently favorited statuses by R Foundation:

favs <- get_favorites("_R_Foundation", n = 10)


Communicating with Twitter’s APIs relies on an internet connection, which can sometimes be inconsistent.

If you have questions, or need an example or want to share a use case, you can post them on rOpenSci’s discuss. Where you can browse uses of rtweet too.

With that said, if you encounter an obvious bug for which there is not already an active issue, please create a new issue with all code used (preferably a reproducible example) on Github.

Code of Conduct

Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Download Details:

Author: ropensci
Source Code: https://github.com/ropensci/rtweet 
License: View license

#r #twitter #rest 

Rtweet: R Client for interacting with Twitter's [stream and REST] APIs

Hybridauth: Open Source Social Sign on PHP Library

Hybridauth 3.8

Hybridauth enables developers to easily build social applications and tools to engage websites visitors and customers on a social level that starts off with social sign-in and extends to social sharing, users profiles, friends lists, activities streams, status updates and more.

The main goal of Hybridauth is to act as an abstract API between your application and the various social networks APIs and identities providers such as Facebook, Twitter and Google.


Hybridauth provides a number of basic examples. You can also find complete Hybridauth documentation at https://hybridauth.github.io

$config = [
    'callback' => 'https://example.com/path/to/script.php',
    'keys' => [
        'key' => 'your-twitter-consumer-key',
        'secret' => 'your-twitter-consumer-secret',

try {
    $twitter = new Hybridauth\Provider\Twitter($config);


    $accessToken = $twitter->getAccessToken();
    $userProfile = $twitter->getUserProfile();
    $apiResponse = $twitter->apiRequest('statuses/home_timeline.json');
catch (\Exception $e) {
    echo 'Oops, we ran into an issue! ' . $e->getMessage();


  • PHP 5.4+
  • PHP Session
  • PHP cURL


To install Hybridauth we recommend Composer, the now defacto dependency manager for PHP. Alternatively, you can download and use the latest release available at Github.

Versions Status

VersionStatusRepositoryDocumentationPHP Version
2.xMaintenance[v2][hybridauth-2-repo][v2][hybridauth-2-docs]>= 5.3
3.xDevelopment[v3][hybridauth-3-repo][v3][hybridauth-3-docs]>= 5.4
4.xFuture---->= 7.3

Questions, Help and Support?

For general questions (i.e, "how-to" questions), please consider using StackOverflow instead of the Github issues tracker. For convenience, we also have a [low-activity] Gitter channel if you want to get help directly from the community.

Download Details:

Author: Hybridauth
Source Code: https://github.com/hybridauth/hybridauth 
License: View license

#php #google #facebook #twitter 

Hybridauth: Open Source Social Sign on PHP Library
Rupert  Beatty

Rupert Beatty


ActiveLabel.swift: UILabel drop-in replacement supporting Hashtags (#)


UILabel drop-in replacement supporting Hashtags (#), Mentions (@), URLs (http://), Emails and custom regex patterns, written in Swift


  • Swift 5.0 (1.1.0+) and 4.2 (1.0.1)
  • Default support for Hashtags, Mentions, Links, Emails
  • Support for custom types via regex
  • Ability to enable highlighting only for the desired types
  • Ability to trim urls
  • Super easy to use and lightweight
  • Works as UILabel drop-in replacement
  • Well tested and documented

Install (iOS 10+)


Add the following to your Cartfile and follow these instructions

github "optonaut/ActiveLabel.swift"


CocoaPods 0.36 adds supports for Swift and embedded frameworks. To integrate ActiveLabel into your project add the following to your Podfile:

platform :ios, '10.0'

pod 'ActiveLabel'


import ActiveLabel

let label = ActiveLabel()
label.numberOfLines = 0
label.enabledTypes = [.mention, .hashtag, .url, .email]
label.text = "This is a post with #hashtags and a @userhandle."
label.textColor = .black
label.handleHashtagTap { hashtag in
    print("Success. You just tapped the \(hashtag) hashtag")

Custom types

let customType = ActiveType.custom(pattern: "\\swith\\b") //Regex that looks for "with"
label.enabledTypes = [.mention, .hashtag, .url, .email, customType]
label.text = "This is a post with #hashtags and a @userhandle."
label.customColor[customType] = UIColor.purple
label.customSelectedColor[customType] = UIColor.green
label.handleCustomTap(for: customType) { element in
    print("Custom type tapped: \(element)")

Enable/disable highlighting

By default, an ActiveLabel instance has the following configuration

label.enabledTypes = [.mention, .hashtag, .url, .email]

But feel free to enable/disable to fit your requirements

Batched customization

When using ActiveLabel, it is recommended to use the customize(block:) method to customize it. The reason is that ActiveLabel is reacting to each property that you set. So if you set 3 properties, the textContainer is refreshed 3 times.

When using customize(block:), you can group all the customizations on the label, that way ActiveLabel is only going to refresh the textContainer once.


label.customize { label in
    label.text = "This is a post with #multiple #hashtags and a @userhandle."
    label.textColor = UIColor(red: 102.0/255, green: 117.0/255, blue: 127.0/255, alpha: 1)
    label.hashtagColor = UIColor(red: 85.0/255, green: 172.0/255, blue: 238.0/255, alpha: 1)
    label.mentionColor = UIColor(red: 238.0/255, green: 85.0/255, blue: 96.0/255, alpha: 1)
    label.URLColor = UIColor(red: 85.0/255, green: 238.0/255, blue: 151.0/255, alpha: 1)
    label.handleMentionTap { self.alert("Mention", message: $0) }
    label.handleHashtagTap { self.alert("Hashtag", message: $0) }
    label.handleURLTap { self.alert("URL", message: $0.absoluteString) }

Trim long urls

You have the possiblity to set the maximum lenght a url can have;

label.urlMaximumLength = 30

From now on, a url that's bigger than that, will be trimmed.

https://afancyurl.com/whatever -> https://afancyurl.com/wh...


mentionColor: UIColor = .blueColor()

mentionSelectedColor: UIColor?

hashtagColor: UIColor = .blueColor()

hashtagSelectedColor: UIColor?

URLColor: UIColor = .blueColor()

URLSelectedColor: UIColor?

customColor: [ActiveType : UIColor]

customSelectedColor: [ActiveType : UIColor]

lineSpacing: Float?

handleMentionTap: (String) -> ()

label.handleMentionTap { userHandle in print("\(userHandle) tapped") }

handleHashtagTap: (String) -> ()

label.handleHashtagTap { hashtag in print("\(hashtag) tapped") }

handleURLTap: (NSURL) -> ()

label.handleURLTap { url in UIApplication.shared.openURL(url) }

handleEmailTap: (String) -> ()

label.handleEmailTap { email in print("\(email) tapped") }

handleCustomTap(for type: ActiveType, handler: (String) -> ())

label.handleCustomTap(for: customType) { element in print("\(element) tapped") }

filterHashtag: (String) -> Bool

label.filterHashtag { hashtag in validHashtags.contains(hashtag) }

filterMention: (String) -> Bool

label.filterMention { mention in validMentions.contains(mention) }


Before writing ActiveLabel we've tried a lot of the following alternatives but weren't quite satisfied with the quality level or ease of usage, so we decided to contribute our own solution.

  • TTTAttributedLabel (ObjC) - A drop-in replacement for UILabel that supports attributes, data detectors, links, and more
  • STTweetLabel (ObjC) - A UILabel with #hashtag @handle and links tappable
  • AMAttributedHighlightLabel (ObjC) - A UILabel subclass with mention/hashtag/link highlighting
  • KILabel (ObjC) - A simple to use drop in replacement for UILabel for iOS 7 and above that highlights links such as URLs, twitter style usernames and hashtags and makes them touchable

Download Details:

Author: optonaut
Source Code: https://github.com/optonaut/ActiveLabel.swift 
License: MIT license

#swift #hashtags #twitter 

ActiveLabel.swift: UILabel drop-in replacement supporting Hashtags (#)
Ella  Windler

Ella Windler


Twitter Watch: Tracking The Far Right on Twitter

Twitter reports


This project tracks far-right and far-right-adjacent accounts on Twitter.

Each daily report includes three tables:

  • A list of tracked accounts identified as suspended on that day, sorted by their centrality to far-right networks.
  • A list of tracked accounts identified as having changed their screen name on that day.
  • A list of untracked accounts identified as suspended on that day, sorted by follower count.

In this context a tracked account is one that is identified as having connections to far-right networks on Twitter. The presence of an account on this list does not indicate that it is identified as supporting far-right causes or spreading far-right content, just that it has connections to far-right networks.

The third table only includes suspended untracked accounts with more than 1000 followers. These are often bots or spam accounts.

Suspension (and suspension reversal) dates indicate when the change in account status was detected, which in some cases may be up to several days after the change occurred.

Chart of total daily suspension counts Chart of total daily screen name change counts


  • Total number of suspensions detected: 272684
  • Total number of suspension reversals detected: 6904
  • Mean number of followers for suspended accounts: 1936.8
  • Median number of followers for suspended accounts: 54.0
  • Mean age of suspended accounts (days): 1066.95
  • Median age of suspended accounts (days): 315.0
  • Total number of verified accounts suspended: 114
  • Total number of protected accounts suspended: 13316
  • Total number of suspensions for accounts previously withheld in specific countries: 21
  • Total number of screen name changes detected: 675778

Top 20 suspensions

Current list of suspensions of accounts most central to far-right networks since the creation of this project.

 Screen nameCreatedSuspendedFollowersRanking
ConceptualJames (1 other2012-09-162022-08-0531583418
RekietaLaw (2 others2018-08-142022-09-2712431291
America1Scotty (2 others2019-08-132022-09-018152396
MillerStream (1 other2009-04-082022-06-259560399
isabellarileyus (2 others2014-10-222022-07-1082381106
DrKarlynB (2 others2007-06-142022-08-1970487111
ASBMilitary (1 other2020-02-092022-03-11198960122
DJTTracker (1 other2021-07-182022-07-1662859141
QuarantinedCoof (1 other2016-01-152022-09-0270298154
crackconnoisser (1 other2021-05-142022-08-2180314155
DeIudedShaniqwa (4 others2021-02-112022-03-1451795167
MAGA__Patriot (2 others2015-08-232022-06-2437660191
realGonzaloLira (2 others2018-10-302022-09-1659938208

Daily reports

DateTotal suspensionsTracked suspensionsTracked screen name changes
14 October 20221287190
13 October 20221850178
12 October 202220064729
11 October 202217112927
10 October 202215813326
9 October 202211261729
8 October 202215551419
7 October 202214382923
6 October 202216865529
5 October 202216142431
4 October 202213902130
3 October 202214541826
2 October 202210982022
1 October 202217192349
30 September 20221594414
29 September 202217153426
28 September 202216173747
27 September 20221062188
26 September 202215213350
25 September 20221455178
24 September 202216562131
23 September 202253452934
22 September 202223334434
21 September 202248213423
20 September 202228612531
19 September 202218473029
18 September 202227031221
17 September 202219093031
16 September 202221956430
15 September 202214632718
14 September 202216251922
13 September 202220523428
12 September 202215933129
11 September 202212251526
10 September 202220663225
9 September 202220212337
8 September 202220713519
7 September 202211042930
6 September 20223912322
5 September 20229401623
4 September 20229692123
3 September 202213113831
2 September 202214814841
1 September 202215172338
31 August 202212172952
30 August 202215344511
29 August 202214372019
28 August 202212462223
27 August 202214132025
26 August 202224313655
25 August 202217113123
24 August 202217335430
23 August 202214054538
22 August 202218253127
21 August 202212063335
20 August 202215722933
19 August 202219874334
18 August 202212954923
17 August 202216286031
16 August 202210753431
15 August 202211684338
14 August 20228453027
13 August 202213452757
12 August 20229654425
11 August 2022126065103
10 August 202217677141
9 August 20224184240
8 August 202212634643
7 August 202211154632
6 August 20228123257
5 August 20229013733
4 August 202213943835
3 August 20229985135
2 August 202210392811
1 August 20229302129
31 July 202210792443
30 July 20221167159
29 July 202210813337
28 July 202228075442
27 July 202221554846
26 July 202228892813
25 July 202217472837
24 July 202210344041
23 July 202215392732
22 July 202213833572
21 July 20221519415
20 July 202213852529
19 July 202210933357
18 July 202215443788
17 July 202220258210
16 July 2022246919713
15 July 20222268413
14 July 202212035788
13 July 202223816110
12 July 202213973867
11 July 20222974248
10 July 20224301655
9 July 20226812323
8 July 20227532658
7 July 202211005161
6 July 20228611926
5 July 20227833834
4 July 20226222040
3 July 2022382092178
29 June 20221820327
28 June 202219625635
27 June 20227712868
26 June 202214062723
25 June 202214234268
24 June 20226671765
23 June 20221639247
22 June 20227632079
21 June 2022864346
20 June 20229813845
19 June 202213781319
18 June 20228312284
17 June 20221688249
16 June 20223583375
15 June 202220894610
14 June 202212272616
13 June 202216143099
12 June 20221630468
10 June 202210771331
9 June 20227243569
8 June 2022795589
7 June 20228183999
6 June 2022880475
5 June 20221244119
4 June 202210795638
3 June 20225328334
2 June 202211133159
1 June 202215965276
31 May 20226923630
30 May 2022709107
29 May 20227762080
28 May 20229071218
27 May 20228402046
26 May 20229693354
25 May 202223202255
24 May 20227422471
23 May 20221012810
22 May 20227331349
21 May 202210682998
20 May 2022811118
19 May 20228922485
18 May 2022822115
17 May 20226311547
16 May 202213981059
15 May 20225252219
14 May 20229251662
13 May 202211161874
12 May 2022941157
11 May 20225571079
10 May 20221178277
9 May 202211722469
8 May 2022519864
7 May 20226791159
6 May 202214374236
5 May 2022130060111
4 May 20229271636
3 May 202212913150
2 May 20228672239
1 May 20226761355
30 April 2022162114189
29 April 20225193112
28 April 2022765619
27 April 2022106427192
26 April 20224811517
25 April 2022103616252
24 April 20223915615
23 April 202212941246
18 April 2022150027
17 April 2022105516101
16 April 202232340
15 April 2022120517118
14 April 2022532911
13 April 2022662186
12 April 20226362462
11 April 202275165
10 April 20227981446
9 April 20229681438
8 April 2022643755
7 April 20228361858
6 April 20227192076
5 April 202216403053
4 April 202210266157
3 April 20221000511
2 April 2022881837
1 April 2022603521
31 March 20228721560
30 March 202210042466
29 March 2022862545
28 March 2022565842
27 March 2022548951
26 March 20227931335
25 March 2022871628
24 March 20228811346
23 March 20228951640
22 March 202210381748
21 March 20225341044
20 March 2022750529
19 March 202211341346
18 March 2022526945
17 March 202210391757
16 March 202212651817
15 March 20228241046
14 March 202212791051
13 March 2022632531
12 March 2022439939
11 March 20228681552
10 March 2022508619
9 March 2022927969
8 March 20225141734
7 March 20226531051
6 March 2022641641
5 March 2022556354
4 March 20225451037
3 March 2022776951
2 March 20221215863
1 March 20227091238
28 February 20226071260
27 February 2022279247
26 February 2022866553
25 February 2022566937
24 February 20222851133
23 February 20225001166
22 February 2022615758
21 February 2022419756
20 February 20221241378
19 February 20225611032
18 February 2022505366
17 February 2022206251
16 February 2022673662
15 February 20227025153
14 February 2022102822
13 February 20223741192


The software in this repository (currently only report formatting code) is published under the Anti-Capitalist Software License (v. 1.4).

Download Details:

Author: travisbrown
Source Code: https://github.com/travisbrown/twitter-watch

 License: View license


Twitter Watch: Tracking The Far Right on Twitter
Lawrence  Lesch

Lawrence Lesch


Twit: Twitter API Client for Node (REST & Streaming API)


Twitter API Client for node

Supports both the REST and Streaming API.


npm install twit


var Twit = require('twit')

var T = new Twit({
  consumer_key:         '...',
  consumer_secret:      '...',
  access_token:         '...',
  access_token_secret:  '...',
  timeout_ms:           60*1000,  // optional HTTP request timeout to apply to all requests.
  strictSSL:            true,     // optional - requires SSL certificates to be valid.

//  tweet 'hello world!'
T.post('statuses/update', { status: 'hello world!' }, function(err, data, response) {

//  search twitter for all tweets containing the word 'banana' since July 11, 2011
T.get('search/tweets', { q: 'banana since:2011-07-11', count: 100 }, function(err, data, response) {

//  get the list of user id's that follow @tolga_tezel
T.get('followers/ids', { screen_name: 'tolga_tezel' },  function (err, data, response) {

// Twit has promise support; you can use the callback API,
// promise API, or both at the same time.
T.get('account/verify_credentials', { skip_status: true })
  .catch(function (err) {
    console.log('caught error', err.stack)
  .then(function (result) {
    // `result` is an Object with keys "data" and "resp".
    // `data` and `resp` are the same objects as the ones passed
    // to the callback.
    // See https://github.com/ttezel/twit#tgetpath-params-callback
    // for details.

    console.log('data', result.data);

//  retweet a tweet with id '343360866131001345'
T.post('statuses/retweet/:id', { id: '343360866131001345' }, function (err, data, response) {

//  destroy a tweet with id '343360866131001345'
T.post('statuses/destroy/:id', { id: '343360866131001345' }, function (err, data, response) {

// get `funny` twitter users
T.get('users/suggestions/:slug', { slug: 'funny' }, function (err, data, response) {

// post a tweet with media
var b64content = fs.readFileSync('/path/to/img', { encoding: 'base64' })

// first we must post the media to Twitter
T.post('media/upload', { media_data: b64content }, function (err, data, response) {
  // now we can assign alt text to the media, for use by screen readers and
  // other text-based presentations and interpreters
  var mediaIdStr = data.media_id_string
  var altText = "Small flowers in a planter on a sunny balcony, blossoming."
  var meta_params = { media_id: mediaIdStr, alt_text: { text: altText } }

  T.post('media/metadata/create', meta_params, function (err, data, response) {
    if (!err) {
      // now we can reference the media and post a tweet (media will attach to the tweet)
      var params = { status: 'loving life #nofilter', media_ids: [mediaIdStr] }

      T.post('statuses/update', params, function (err, data, response) {

// post media via the chunked media upload API.
// You can then use POST statuses/update to post a tweet with the media attached as in the example above using `media_id_string`.
// Note: You can also do this yourself manually using T.post() calls if you want more fine-grained
// control over the streaming. Example: https://github.com/ttezel/twit/blob/master/tests/rest_chunked_upload.js#L20
var filePath = '/absolute/path/to/file.mp4'
T.postMediaChunked({ file_path: filePath }, function (err, data, response) {

//  stream a sample of public statuses
var stream = T.stream('statuses/sample')

stream.on('tweet', function (tweet) {

//  filter the twitter public stream by the word 'mango'.
var stream = T.stream('statuses/filter', { track: 'mango' })

stream.on('tweet', function (tweet) {

// filter the public stream by the latitude/longitude bounded box of San Francisco
var sanFrancisco = [ '-122.75', '36.8', '-121.75', '37.8' ]

var stream = T.stream('statuses/filter', { locations: sanFrancisco })

stream.on('tweet', function (tweet) {

// filter the public stream by english tweets containing `#apple`
var stream = T.stream('statuses/filter', { track: '#apple', language: 'en' })

stream.on('tweet', function (tweet) {

twit API:

var T = new Twit(config)

Create a Twit instance that can be used to make requests to Twitter's APIs.

If authenticating with user context, config should be an object of the form:

    consumer_key:         '...'
  , consumer_secret:      '...'
  , access_token:         '...'
  , access_token_secret:  '...'

If authenticating with application context, config should be an object of the form:

    consumer_key:         '...'
  , consumer_secret:      '...'
  , app_only_auth:        true

Note that Application-only auth will not allow you to perform requests to API endpoints requiring a user context, such as posting tweets. However, the endpoints available can have a higher rate limit.

T.get(path, [params], callback)

GET any of the REST API endpoints.


The endpoint to hit. When specifying path values, omit the '.json' at the end (i.e. use 'search/tweets' instead of 'search/tweets.json').


(Optional) parameters for the request.


function (err, data, response)

  • data is the parsed data received from Twitter.
  • response is the [http.IncomingMessage](http://nodejs.org/api/http.html# http_http_incomingmessage) received from Twitter.

T.post(path, [params], callback)

POST any of the REST API endpoints. Same usage as T.get().

T.postMediaChunked(params, callback)

Helper function to post media via the POST media/upload (chunked) API. params is an object containing a file_path key. file_path is the absolute path to the file you want to upload.

var filePath = '/absolute/path/to/file.mp4'
T.postMediaChunked({ file_path: filePath }, function (err, data, response) {

You can also use the POST media/upload API via T.post() calls if you want more fine-grained control over the streaming; [see here for an example](https://github.com/ttezel/twit/blob/master/tests/rest_chunked_upload.js# L20).


Get the client's authentication tokens.


Update the client's authentication tokens.

T.stream(path, [params])

Use this with the Streaming API.


Streaming endpoint to hit. One of:

  • 'statuses/filter'
  • 'statuses/sample'
  • 'statuses/firehose'
  • 'user'
  • 'site'

For a description of each Streaming endpoint, see the Twitter API docs.


(Optional) parameters for the request. Any Arrays passed in params get converted to comma-separated strings, allowing you to do requests like:

// I only want to see tweets about my favorite fruits

// same result as doing { track: 'bananas,oranges,strawberries' }
var stream = T.stream('statuses/filter', { track: ['bananas', 'oranges', 'strawberries'] })

stream.on('tweet', function (tweet) {

Using the Streaming API

T.stream(path, [params]) keeps the connection alive, and returns an EventEmitter.

The following events are emitted:

event: 'message'

Emitted each time an object is received in the stream. This is a catch-all event that can be used to process any data received in the stream, rather than using the more specific events documented below. New in version 2.1.0.

stream.on('message', function (msg) {

event: 'tweet'

Emitted each time a status (tweet) comes into the stream.

stream.on('tweet', function (tweet) {

event: 'delete'

Emitted each time a status (tweet) deletion message comes into the stream.

stream.on('delete', function (deleteMessage) {

event: 'limit'

Emitted each time a limitation message comes into the stream.

stream.on('limit', function (limitMessage) {

event: 'scrub_geo'

Emitted each time a location deletion message comes into the stream.

stream.on('scrub_geo', function (scrubGeoMessage) {

event: 'disconnect'

Emitted when a disconnect message comes from Twitter. This occurs if you have multiple streams connected to Twitter's API. Upon receiving a disconnect message from Twitter, Twit will close the connection and emit this event with the message details received from twitter.

stream.on('disconnect', function (disconnectMessage) {

event: 'connect'

Emitted when a connection attempt is made to Twitter. The http request object is emitted.

stream.on('connect', function (request) {

event: 'connected'

Emitted when the response is received from Twitter. The http response object is emitted.

stream.on('connected', function (response) {

event: 'reconnect'

Emitted when a reconnection attempt to Twitter is scheduled. If Twitter is having problems or we get rate limited, we schedule a reconnect according to Twitter's reconnection guidelines. The last http request and response objects are emitted, along with the time (in milliseconds) left before the reconnect occurs.

stream.on('reconnect', function (request, response, connectInterval) {

event: 'warning'

This message is appropriate for clients using high-bandwidth connections, like the firehose. If your connection is falling behind, Twitter will queue messages for you, until your queue fills up, at which point they will disconnect you.

stream.on('warning', function (warning) {

event: 'status_withheld'

Emitted when Twitter sends back a status_withheld message in the stream. This means that a tweet was withheld in certain countries.

stream.on('status_withheld', function (withheldMsg) {

event: 'user_withheld'

Emitted when Twitter sends back a user_withheld message in the stream. This means that a Twitter user was withheld in certain countries.

stream.on('user_withheld', function (withheldMsg) {

event: 'friends'

Emitted when Twitter sends the ["friends" preamble](https://dev.twitter.com/streaming/overview/messages-types# user_stream_messsages) when connecting to a user stream. This message contains a list of the user's friends, represented as an array of user ids. If the stringify_friend_ids parameter is set, the friends list preamble will be returned as Strings (instead of Numbers).

var stream = T.stream('user', { stringify_friend_ids: true })
stream.on('friends', function (friendsMsg) {

event: 'direct_message'

Emitted when a direct message is sent to the user. Unfortunately, Twitter has not documented this event for user streams.

stream.on('direct_message', function (directMsg) {

event: 'user_event'

Emitted when Twitter sends back a User stream event. See the Twitter docs for more information on each event's structure.

stream.on('user_event', function (eventMsg) {

In addition, the following user stream events are provided for you to listen on:

  • blocked
  • unblocked
  • favorite
  • unfavorite
  • follow
  • unfollow
  • mute
  • unmute
  • user_update
  • list_created
  • list_destroyed
  • list_updated
  • list_member_added
  • list_member_removed
  • list_user_subscribed
  • list_user_unsubscribed
  • quoted_tweet
  • retweeted_retweet
  • favorited_retweet
  • unknown_user_event (for an event that doesn't match any of the above)


stream.on('favorite', function (event) {

event: 'error'

Emitted when an API request or response error occurs. An Error object is emitted, with properties:

  message:      '...',  // error message
  statusCode:   '...',  // statusCode from Twitter
  code:         '...',  // error code from Twitter
  twitterReply: '...',  // raw response data from Twitter
  allErrors:    '...'   // array of errors returned from Twitter


Call this function on the stream to stop streaming (closes the connection with Twitter).


Call this function to restart the stream after you called .stop() on it. Note: there is no need to call .start() to begin streaming. Twit.stream calls .start() for you.

What do I have access to?

Anything in the Twitter API:

Go here to create an app and get OAuth credentials (if you haven't already): https://apps.twitter.com/app/new


You may specify an array of trusted certificate fingerprints if you want to only trust a specific set of certificates. When an HTTP response is received, it is verified that the certificate was signed, and the peer certificate's fingerprint must be one of the values you specified. By default, the node.js trusted "root" CAs will be used.


var twit = new Twit({
  consumer_key:         '...',
  consumer_secret:      '...',
  access_token:         '...',
  access_token_secret:  '...',
  trusted_cert_fingerprints: [


  • Make your changes
  • Make sure your code matches the style of the code around it
  • Add tests that cover your feature/bugfix
  • Run tests
  • Submit a pull request

How do I run the tests?

Create two files: config1.js and config2.js at the root of the twit folder. They should contain two different sets of oauth credentials for twit to use (two accounts are needed for testing interactions). They should both look something like this:

module.exports = {
    consumer_key: '...'
  , consumer_secret: '...'
  , access_token: '...'
  , access_token_secret: '...'

Then run the tests:

npm test

You can also run the example:

node examples/rtd2.js


The example is a twitter bot named RTD2 written using twit. RTD2 tweets about github and curates its social graph.



(The MIT License)

Copyright (c) by Tolga Tezel tolgatezel11@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.




  • Fix media_category used for media uploads (thanks @BooDoo)


  • Update maximum Tweet characters to 280 (thanks @maziyarpanahi)
  • For streaming requests, use request body for sending params (thanks @raine)
  • Fix getBearerToken endpoint (thanks @williamcoates)
  • Shared Parameter Feature For Media Upload (thanks @haroonabbasi)
  • Don't include params in path for jsonpayload paths (thanks @egtoney)
  • Add support for strictSSL request option (thanks @zdoc01)


  • Use JSON payload in request body for new DM endpoints.


  • Add support for HTTP DELETE; you can now T.delete(...).


  • Don't attempt to reconnect to Twitter API when receiving HTTP status code 413 - request entity too large.


  • Fix zlib error when streaming


  • Fix 401 Unauthorized error on streaming connection reconnect after not being connected for some time (eg. due to > 1min loss of network).


  • Emit parser-error instead of error event if Twitter sends back an uncompressed HTTP response body.


  • Add promise support to Twit REST API calls.


  • Allow omission of new keyword; var t = Twit(config) works, and var t = new Twit(config) works too.
  • Allow setting an array of trusted certificate fingerprints via config.trusted_cert_fingerprints.
  • Automatically adjust timestamp for OAuth'ed HTTP requests by recording the timestamp from Twitter HTTP responses, computing our local time offset, and applying the offset in the next HTTP request to Twitter.


  • Add mime as a dependency.


  • Emit friends event for friends_str message received when a user stream is requested with stringify_friend_ids=true.
  • Handle receiving "Exceeded connection limit for user" message from Twitter while streaming. Emit error event for this case.
  • Emit retweeted_retweet and favorited_retweet user events.
  • Add MIT license to package.json (about time!)


  • Support config-based request timeout.


  • Support POST media/upload (chunked) and add T.postMediaChunked() to make it easy.


  • Fix bug in constructing HTTP requests for account/update_profile_image and account/update_profile_background_image paths.


  • Enable gzip on network traffic
  • Add quoted_tweet event


  • Strict-mode fixes (Twit can now be run with strict mode)
  • Fix handling of disconect message from Twitter
  • If Twitter returns a non-JSON-parseable fragment during streaming, emit 'parser-error' instead of 'error' (to discard fragments like "Internal Server Error")


  • Add message event.


  • Implement Application-only auth
  • Remove oauth module as a dependency


  • Implement support for POST /media/upload
  • Reconnect logic fix for streaming; add stall abort/reconnect timeout on first connection attempt.


  • Emit connected event upon receiving the response from twitter


  • now to stop and start the stream, use stream.stop() and stream.start() instead of emitting the start and stop events
  • If twitter sends a disconnect message, closes the stream and emits disconnect with the disconnect message received from twitter


  • Updated twit for usage with v1.1 of the Twitter API.


  • BREAKING CHANGE to twit.stream(). Does not take a callback anymore. It returns immediately with the EventEmitter that you can listen on. The Usage section in the Readme.md has been updated. Read it.


  • twit.stream() has signature function (path, params, callback)

Download Details:

Author: ttezel
Source Code: https://github.com/ttezel/twit 

#javascript #twitter #api #client #node 

Twit: Twitter API Client for Node (REST & Streaming API)

Third-party Web APIs Plugins with Python and Twitter

In this Python article, we learn about Third-party Web APIs: Third-party Web APIs Plugins with Python and Twitter

  1. Twitter: Python Twitter API
  2. Simple Salesforce: A very simple Salesforce.com REST API client for Python
  3. sherlock: 🔎 Hunt down social media accounts by username across social networks
  4. Instagram Scraper: Scrapes an instagram user's photos and videos
  5. gallery-dl: Command-line program to download image galleries and collections from several image hosting sites
  6. Twitter Scraper: Scrape the Twitter Frontend API without authentication.

What is Python?

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. 

What is Twitter?

Twitter is an online news and social networking site where people communicate in short messages called tweets. Tweeting is posting short messages for anyone who follows you on Twitter, with the hope that your words are useful and interesting to someone in your audience


Third-party Web APIs Plugins with Python and Twitter


The Minimalist Twitter API for Python is a Python API for Twitter, everyone's favorite Web 2.0 Facebook-style status updater for people on the go.

Also included is a Twitter command-line tool for getting your friends' tweets and setting your own tweet from the safety and security of your favorite shell and an IRC bot that can announce Twitter updates to an IRC channel.

For more information:

  • install the package pip install twitter
  • import the twitter package and run help() on it
  • run twitter -h for command-line tool help

twitter - The Command-Line Tool

The command-line tool lets you do some awesome things:

  • view your tweets, recent replies, and tweets in lists
  • view the public timeline
  • follow and unfollow (leave) friends
  • various output formats for tweet information

The bottom line: type twitter, receive tweets.

twitterbot - The IRC Bot

The IRC bot is associated with a Twitter account (either your own account or an account you create for the bot). The bot announces all tweets from friends it is following. It can be made to follow or leave friends through IRC /msg commands.

View on GitHub

2.     Simple Salesforce

Simple Salesforce is a basic Salesforce.com REST API client built for Python 3.5, 3.6, 3.7 and 3.8. The goal is to provide a very low-level interface to the REST Resource and APEX API, returning a dictionary of the API JSON response.


There are two ways to gain access to Salesforce

The first is to simply pass the domain of your Salesforce instance and an access token straight to Salesforce()

For example:

from simple_salesforce import Salesforce
sf = Salesforce(instance='na1.salesforce.com', session_id='')

If you have the full URL of your instance (perhaps including the schema, as is included in the OAuth2 request process), you can pass that in instead using instance_url:

from simple_salesforce import Salesforce
sf = Salesforce(instance_url='https://na1.salesforce.com', session_id='')

There are also three means of authentication, one that uses username, password and security token; one that uses IP filtering, username, password and organizationId; and the other that uses a private key to sign a JWT.

To login using the security token method, simply include the Salesforce method and pass in your Salesforce username, password and token (this is usually provided when you change your password):

from simple_salesforce import Salesforce
sf = Salesforce(username='myemail@example.com', password='password', security_token='token')

To login using IP-whitelist Organization ID method, simply use your Salesforce username, password and organizationId:

from simple_salesforce import Salesforce
sf = Salesforce(password='password', username='myemail@example.com', organizationId='OrgId')

To login using the JWT method, use your Salesforce username, consumer key from your app, and private key (How To):

from simple_salesforce import Salesforce
sf = Salesforce(username='myemail@example.com', consumer_key='XYZ', privatekey_file='filename.key')

If you'd like to enter a sandbox, simply add domain='test' to your Salesforce() call.

For example:

from simple_salesforce import Salesforce
sf = Salesforce(username='myemail@example.com.sandbox', password='password', security_token='token', domain='test')

Note that specifying if you want to use a domain is only necessary if you are using the built-in username/password/security token authentication and is used exclusively during the authentication step.

If you'd like to keep track where your API calls are coming from, simply add client_id='My App' to your Salesforce() call.

from simple_salesforce import Salesforce
sf = Salesforce(username='myemail@example.com.sandbox', password='password', security_token='token', client_id='My App', domain='test')

If you view the API calls in your Salesforce instance by Client Id it will be prefixed with RestForce/, for example RestForce/My App.

View on GitHub

3.    sherlock

🔎 Hunt down social media accounts by username across social networks


# clone the repo
$ git clone https://github.com/sherlock-project/sherlock.git

# change the working directory to sherlock
$ cd sherlock

# install the requirements
$ python3 -m pip install -r requirements.txt


$ python3 sherlock --help
usage: sherlock [-h] [--version] [--verbose] [--folderoutput FOLDEROUTPUT]
                [--output OUTPUT] [--tor] [--unique-tor] [--csv]
                [--site SITE_NAME] [--proxy PROXY_URL] [--json JSON_FILE]
                [--timeout TIMEOUT] [--print-all] [--print-found] [--no-color]
                [--browse] [--local]
                USERNAMES [USERNAMES ...]

Sherlock: Find Usernames Across Social Networks (Version 0.14.0)

positional arguments:
  USERNAMES             One or more usernames to check with social networks.

optional arguments:
  -h, --help            show this help message and exit
  --version             Display version information and dependencies.
  --verbose, -v, -d, --debug
                        Display extra debugging information and metrics.
                        If using multiple usernames, the output of the results
                        will be saved to this folder.
  --output OUTPUT, -o OUTPUT
                        If using single username, the output of the result
                        will be saved to this file.
  --tor, -t             Make requests over Tor; increases runtime; requires
                        Tor to be installed and in system path.
  --unique-tor, -u      Make requests over Tor with new Tor circuit after each
                        request; increases runtime; requires Tor to be
                        installed and in system path.
  --csv                 Create Comma-Separated Values (CSV) File.
  --site SITE_NAME      Limit analysis to just the listed sites. Add multiple
                        options to specify more than one site.
  --proxy PROXY_URL, -p PROXY_URL
                        Make requests over a proxy. e.g.
  --json JSON_FILE, -j JSON_FILE
                        Load data from a JSON file or an online, valid, JSON
  --timeout TIMEOUT     Time (in seconds) to wait for response to requests.
                        Default timeout is infinity. A longer timeout will be
                        more likely to get results from slow sites. On the
                        other hand, this may cause a long delay to gather all
  --print-all           Output sites where the username was not found.
  --print-found         Output sites where the username was found.
  --no-color            Don't color terminal output
  --browse, -b          Browse to all results on default browser.
  --local, -l           Force the use of the local data.json file.

To search for only one user:

python3 sherlock user123

To search for more than one user:

python3 sherlock user1 user2 user3

Accounts found will be stored in an individual text file with the corresponding username (e.g user123.txt).

View on GitHub

4.    Instagram Scraper

instagram-scraper is a command-line application written in Python that scrapes and downloads an instagram user's photos and videos. Use responsibly.


To install instagram-scraper:

$ pip install instagram-scraper

To update instagram-scraper:

$ pip install instagram-scraper --upgrade

Alternatively, you can clone the project and run the following command to install: Make sure you cd into the instagram-scraper-master folder before performing the command below.

$ python setup.py install


To scrape a user's media:

$ instagram-scraper <username> -u <your username> -p <your password>             

NOTE: To scrape a private user's media you must be an approved follower.

By default, downloaded media will be placed in <current working directory>/<username>.

Providing username and password is optional, if not supplied the scraper runs as a guest. Note: In this case all private user's media will be unavailable. All user's stories and high resolution profile pictures will also be unavailable.

To scrape a hashtag for media:

$ instagram-scraper <hashtag without #> --tag          

It may be useful to specify the --maximum <#> argument to limit the total number of items to scrape when scraping by hashtag.

To specify multiple users, pass a delimited list of users:

$ instagram-scraper username1,username2,username3           

You can also supply a file containing a list of usernames:

$ instagram-scraper -f ig_users.txt           
# ig_users.txt


# and so on...

The usernames may be separated by newlines, commas, semicolons, or whitespace.

View on GitHub

5.    gallery-dl

gallery-dl is a command-line program to download image galleries and collections from several image hosting sites (see Supported Sites). It is a cross-platform tool with many configuration options and powerful filenaming capabilities.



The stable releases of gallery-dl are distributed on PyPI and can be easily installed or upgraded using pip:

python3 -m pip install -U gallery-dl

Installing the latest dev version directly from GitHub can be done with pip as well:

python3 -m pip install -U -I --no-deps --no-cache-dir https://github.com/mikf/gallery-dl/archive/master.tar.gz

Note: Windows users should use py -3 instead of python3.

It is advised to use the latest version of pip, including the essential packages setuptools and wheel. To ensure these packages are up-to-date, run

python3 -m pip install --upgrade pip setuptools wheel

Standalone Executable

Prebuilt executable files with a Python interpreter and required Python packages included are available for

Executables build from the latest commit can be found at



Linux users that are using a distro that is supported by Snapd can install gallery-dl from the Snap Store:

snap install gallery-dl


Windows users that have Chocolatey installed can install gallery-dl from the Chocolatey Community Packages repository:

choco install gallery-dl


gallery-dl is also available in the Scoop "main" bucket for Windows users:

scoop install gallery-dl

View on GitHub

6.    Twitter Scraper

Twitter's API is annoying to work with, and has lots of limitations — luckily their frontend (JavaScript) has it's own API, which I reverse–engineered. No API rate limits. No restrictions. Extremely fast.

You can use this library to get the text of any user's Tweets trivially.


Before you begin, ensure you have met the following requirements:

  • Internet Connection
  • Python 3.6+

Installing twitter-scraper

If you want to use latest version, install from source. To install twitter-scraper from source, follow these steps:

Linux and macOS:

git clone https://github.com/bisguzar/twitter-scraper.git
cd twitter-scraper
sudo python3 setup.py install 

Also, you can install with PyPI.

pip3 install twitter_scraper

Using twitter_scraper

Just import twitter_scraper and call functions!

→ function get_tweets(query: str [, pages: int]) -> dictionary

You can get tweets of profile or parse tweets from hashtag, get_tweets takes username or hashtag on first parameter as string and how much pages you want to scan on second parameter as integer.

View on GitHub

Related videos:

What are Web APIs?  Web APIs for Beginners

Related posts:

Related posts:

Thank you for following the article, if you find it interesting, please give me a like, share. thank

#python #twitter 

Third-party Web APIs Plugins with Python and Twitter
Quinten  Boehm

Quinten Boehm


Decentralized Twitter with Nft Profile Picture and Tipping

For the Walkthrough of the Application Please Look at Screenshots

Web3 Twitter

Technology Stack & Tools

  • Solidity (Writing Smart Contract)
  • Javascript (React & Testing)
  • Ethers (Blockchain Interaction)
  • Hardhat (Development Framework)
  • Ipfs (Metadata storage)
  • React routers (Navigational components)

Requirements For Initial Setup

  • Install NodeJS, should work with any node version below 16.5.0
  • Install Hardhat

Setting Up

1. Clone/Download the Repository

2. Install Dependencies:

$ cd web3-twitter
$ npm install

3. Boot up local development blockchain

$ cd web3-twitter
$ npx hardhat node

4. Connect development blockchain accounts to Metamask

  • Copy private key of the addresses and import to Metamask
  • Connect your metamask to hardhat blockchain, network
  • If you have not added hardhat to the list of networks on your metamask, open up a browser, click the fox icon, then click the top center dropdown button that lists all the available networks then click add networks. A form should pop up. For the "Network Name" field enter "Hardhat". For the "New RPC URL" field enter "". For the chain ID enter "31337". Then click save.

5. Run deploy script to migrate smart contracts

$ npx hardhat run scripts/deploy.js --network localhost

6. Run Tests

$ npx hardhat test

7. Launch Frontend

$ npm run start

Author: 0xAryanShah
Source code: https://github.com/0xAryanShah/web3_Twitter

#react-native  #typescript #twitter 

Decentralized Twitter with Nft Profile Picture and Tipping

Twitter: A Ruby interface to The Twitter API

The Twitter Ruby Gem   

A Ruby interface to the Twitter API.


gem install twitter


Looking for the Twitter command-line interface? It was removed from this gem in version 0.5.0 and now exists as a separate project.


You should follow @gem on Twitter for announcements and updates about this library.

Mailing List

Please direct questions about this library to the mailing list.

Apps Wiki

Does your project or organization use this gem? Add it to the apps wiki!


Twitter API v1.1 requires you to authenticate via OAuth, so you'll need to register your application with Twitter. Once you've registered an application, make sure to set the correct access level, otherwise you may see the error:

Read-only application cannot POST

Your new application will be assigned a consumer key/secret pair and you will be assigned an OAuth access token/secret pair for that application. You'll need to configure these values before you make a request or else you'll get the error:

Bad Authentication data

You can pass configuration options as a block to Twitter::REST::Client.new.

client = Twitter::REST::Client.new do |config|
  config.consumer_key        = "YOUR_CONSUMER_KEY"
  config.consumer_secret     = "YOUR_CONSUMER_SECRET"
  config.access_token        = "YOUR_ACCESS_TOKEN"
  config.access_token_secret = "YOUR_ACCESS_SECRET"

Usage Examples

After configuring a client, you can do the following things.

Tweet (as the authenticated user)

client.update("I'm tweeting with @gem!")

Follow a user (by screen name or user ID)


Fetch a user (by screen name or user ID)


Fetch a cursored list of followers with profile details (by screen name or user ID, or by implicit authenticated user)


Fetch a cursored list of friends with profile details (by screen name or user ID, or by implicit authenticated user)


Fetch the timeline of Tweets by a user


Fetch the timeline of Tweets from the authenticated user's home page


Fetch the timeline of Tweets mentioning the authenticated user


Fetch a particular Tweet by ID


Collect the three most recent marriage proposals to @justinbieber

client.search("to:justinbieber marry me", result_type: "recent").take(3).collect do |tweet|
  "#{tweet.user.screen_name}: #{tweet.text}"

Find a Japanese-language Tweet tagged #ruby (excluding retweets)

client.search("#ruby -rt", lang: "ja").first.text

For more usage examples, please see the full documentation.


Site Streams are restricted to whitelisted accounts. To apply for access, follow the steps in the Site Streams documentation. User Streams do not require prior approval.

Configuration works just like Twitter::REST::Client

client = Twitter::Streaming::Client.new do |config|
  config.consumer_key        = "YOUR_CONSUMER_KEY"
  config.consumer_secret     = "YOUR_CONSUMER_SECRET"
  config.access_token        = "YOUR_ACCESS_TOKEN"
  config.access_token_secret = "YOUR_ACCESS_SECRET"

Stream a random sample of all tweets

client.sample do |object|
  puts object.text if object.is_a?(Twitter::Tweet)

Stream mentions of coffee or tea

topics = ["coffee", "tea"]
client.filter(track: topics.join(",")) do |object|
  puts object.text if object.is_a?(Twitter::Tweet)

Stream tweets, events, and direct messages for the authenticated user

client.user do |object|
  case object
  when Twitter::Tweet
    puts "It's a tweet!"
  when Twitter::DirectMessage
    puts "It's a direct message!"
  when Twitter::Streaming::StallWarning
    warn "Falling behind!"

An object may be one of the following:

  • Twitter::Tweet
  • Twitter::DirectMessage
  • Twitter::Streaming::DeletedTweet
  • Twitter::Streaming::Event
  • Twitter::Streaming::FriendList
  • Twitter::Streaming::StallWarning


We recommend using the Twitter Ads SDK for Ruby to interact with the Twitter Ads API.

Object Graph

Entity-relationship diagram

This entity-relationship diagram is generated programatically. If you add or remove any Twitter objects, please regenerate the ERD with the following command:

bundle exec rake erd

Supported Ruby Versions

This library aims to support and is tested against the following Ruby versions:

  • Ruby 2.4
  • Ruby 2.5
  • Ruby 2.6
  • Ruby 2.7

If something doesn't work on one of these versions, it's a bug.

This library may inadvertently work (or seem to work) on other Ruby versions, however support will only be provided for the versions listed above.

If you would like this library to support another Ruby version or implementation, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.


This library aims to adhere to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, that version should be immediately yanked and/or a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions. As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision. For example:

spec.add_dependency 'twitter', '~> 6.0'






Copyright (c) 2006-2016 Erik Berlin, John Nunemaker, Wynn Netherland, Steve Richert, Steve Agalloco. See LICENSE for details.

Author: sferik
Source code: https://github.com/sferik/twitter
License: MIT license

#ruby #twitter 

Twitter: A Ruby interface to The Twitter API