update package name

This commit is contained in:
Valentine 2024-01-28 23:06:45 +03:00
parent fdd172a136
commit 8dda773032
7 changed files with 19 additions and 20 deletions

View file

@ -1,6 +1,6 @@
# Twitter Scraper # Twitter Scraper
[![Go Reference](https://pkg.go.dev/badge/github.com/n0madic/twitter-scraper.svg)](https://pkg.go.dev/github.com/n0madic/twitter-scraper) [![Go Reference](https://pkg.go.dev/badge/github.com/imperatrona/twitter-scraper.svg)](https://pkg.go.dev/github.com/imperatrona/twitter-scraper)
Twitter's API is annoying to work with, and has lots of limitations — 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. luckily their frontend (JavaScript) has it's own API, which I reverse-engineered.
@ -11,7 +11,7 @@ You can use this library to get the text of any user's Tweets trivially.
## Installation ## Installation
```shell ```shell
go get -u github.com/n0madic/twitter-scraper go get -u github.com/imperatrona/twitter-scraper
``` ```
## Usage ## Usage
@ -93,7 +93,7 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func main() { func main() {
@ -121,7 +121,7 @@ package main
import ( import (
"fmt" "fmt"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func main() { func main() {
@ -150,7 +150,7 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func main() { func main() {
@ -173,7 +173,6 @@ The search ends if we have 50 tweets.
See [Rules and filtering](https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators) for build standard queries. See [Rules and filtering](https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators) for build standard queries.
#### Set search mode #### Set search mode
```golang ```golang
@ -182,11 +181,11 @@ scraper.SetSearchMode(twitterscraper.SearchLatest)
Options: Options:
* `twitterscraper.SearchTop` - default mode - `twitterscraper.SearchTop` - default mode
* `twitterscraper.SearchLatest` - live mode - `twitterscraper.SearchLatest` - live mode
* `twitterscraper.SearchPhotos` - image mode - `twitterscraper.SearchPhotos` - image mode
* `twitterscraper.SearchVideos` - video mode - `twitterscraper.SearchVideos` - video mode
* `twitterscraper.SearchUsers` - user mode - `twitterscraper.SearchUsers` - user mode
### Get profile ### Get profile
@ -195,7 +194,7 @@ package main
import ( import (
"fmt" "fmt"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func main() { func main() {
@ -217,7 +216,7 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func main() { func main() {
@ -242,7 +241,7 @@ package main
import ( import (
"fmt" "fmt"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func main() { func main() {

View file

@ -3,7 +3,7 @@ package twitterscraper_test
import ( import (
"testing" "testing"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func TestGetGuestToken(t *testing.T) { func TestGetGuestToken(t *testing.T) {

View file

@ -5,7 +5,7 @@ import (
"os" "os"
"testing" "testing"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
var ( var (

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/n0madic/twitter-scraper module github.com/imperatrona/twitter-scraper
go 1.16 go 1.16

View file

@ -7,7 +7,7 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func TestGetProfile(t *testing.T) { func TestGetProfile(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"context" "context"
"testing" "testing"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
func TestFetchSearchCursor(t *testing.T) { func TestFetchSearchCursor(t *testing.T) {

View file

@ -7,7 +7,7 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
twitterscraper "github.com/n0madic/twitter-scraper" twitterscraper "github.com/imperatrona/twitter-scraper"
) )
var cmpOptions = cmp.Options{ var cmpOptions = cmp.Options{