g100g / gatsby-source-twitter Goto Github PK
View Code? Open in Web Editor NEWFetch data from Twitter API
License: MIT License
Fetch data from Twitter API
License: MIT License
Using this plugin with at least "gatsby": "^2.18.4" fails to build with the error:
ERROR #10226 CONFIG
Couldn't find the "gatsby-source-twitter" plugin declared in "gatsby-config.js".
Please add an empty index.js file according to gatsbyjs/gatsby#19150
Occurs on gatsby develop
during bootstrap phase.
Here's my gatsby-config.js
:
{
resolve: "gatsby-source-twitter",
options: {
q: "hello",
count: "5",
credentials: {
consumer_key: keys.TWITTER_CONSUMER_KEY,
consumer_secret: keys.TWITTER_CONSUMER_SECRET,
bearer_token: keys.TWITTER_BEARER_TOKEN,
},
result_type: 'recent'
},
},
error UNHANDLED REJECTION
Error: Tweet.text field type must be Output Type but got: String.
- Array.forEach
- Array.forEach
- Array.forEach
- Array.forEach
The plugin doesn't work on Gatsby v3 due to the node method changes.
npm WARN [email protected] requires a peer of graphql@^0.10.3 but none is installed. You must install peer dependencies yourself.
Certain queries will not return any nodes, yet others will. For example trying to query my small business '@gearheadforge' will not return anything but '@apple' will.
I've followed the setup for getting all of Twitter key's setup, including the bearer token. I know everything works as certain queries are successful, while others are not.
What am I missing here?
Even though I've 1000 members in my list, I get only 20 profiles at once
"pageInfo": {
"currentPage": 1,
"hasNextPage": false,
"hasPreviousPage": false,
"itemCount": 20,
"pageCount": 1,
"perPage": null
}
this is what I get when the pageInfo
is returned.
how to solve this? thanks.
In the last section of the README, "How to query your Tweet's data using GraphQL", text
in tweet_mode: "extended"
returns null
.
full_text
will return the actual tweet. I think full_text
makes more sense as a default.
Here's a copy-and-paste code block if you're keen on this change:
query PageQuery {
allTweet {
edges {
node {
created_at
full_text
user {
name
}
}
}
}
}
Need help. I am planning to fetch users based on a certain keyword in their bio.
For example - If I want to fetch all the developers from India, is it possible to analyze their bio with the keyword "developer" and get user details? Just to curate all the developers at one place.
I tried adding count
in this query and it doesn't seem to work. Is it supported ?
nameofthequery: {
endpoint: "statuses/user_timeline",
params: {
screen_name: "gatsbyjs",
include_rts: false,
exclude_replies: true,
tweet_mode: "extended",
},
}
npm WARN saveError ENOENT: no such file or directory, open '/Users/admin/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/admin/package.json'
Hi, I implemented gatsby-source-twitter in my project, everything worked fine, but suddenly it stopped displaying tweets. Instead, there is: "Loading (StaticQuery)". Do you know what may cause this problem? Thanks for help!
This kind of relates to #8
We have an issue whereby if the account we are using hasn't tweeted in the past 7 days, the plugin throws an error during the build process when 0 nodes are created. In our StaticQuery we then get Unknown field 'allTweet' on type 'Query'.
causing subsequent builds to fail.
Is there a way to avoid GraphQL errors if 0 nodes are created so the build process doesn't break? Any advice appreciated.
Thanks!
Hi!
Sorry for bothering!
I implemented gatsby-source-twitter and it works properly when I run project on localhost, but when I make gatsby build and upload files to the server, it doesn't update latest tweets. Have you got any idea what may cause that problem? I don't even know what part of code I may paste here :/
Thanks!
It seems there is a dependency in the package.json against gatsby v3.0 .. and trying to deploy against gatsby v4
Has anyone had experience of trying to resolve this ?
Many Thanks
$ npm i gatsby-source-twitter npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/gatsby npm ERR! gatsby@"^4.0.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer gatsby@"^3.0.0" from [email protected] npm ERR! node_modules/gatsby-source-twitter npm ERR! gatsby-source-twitter@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /home/user1/.npm/eresolve-report.txt for a full report.
I'm receiving:
error Error from "statuses/user_timeline" - undefined
error [ { code: 215, message: 'Bad Authentication data.' } ]
but I don't see the request being made in Charles or ngrok. I can complete it from Postman, so I know my auth and params are correct. How can I check out the actual request?
gatsby-config.js
{
resolve: `gatsby-source-twitter`,
options: {
credentials: {
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
bearer_token: process.env.TWITTER_BEARER_TOKEN,
},
queries: {
widgetQuery: {
endpoint: `statuses/user_timeline`,
params: {
screen_name: <account>,
include_rts: false,
exclude_replies: true,
// tweet_mode: "extended",
count: 1,
},
},
},
},
},
query
allTwitterWidgetQuery {
edges {
node {
created_at
full_text
user {
name
}
}
}
}
Hi,
I have a gatsby site that uses gatsby-source-twitter
. All worked well until this week when npm run build
started to constantly fail with the following error:
"gatsby-node.js" threw an error while running the onCreateNode lifecycle:
failed to process https://pbs.twimg.com/profile_banners/102656248/1357990904
HTTPError: Response code 404 (Not Found)
Here's the gatsby-source-filter
configuration in gatsby-config.js
{
resolve: "gatsby-source-twitter",
options: {
credentials: {
consumer_key: process.env.TWITTER_API_KEY,
consumer_secret: process.env.TWITTER_API_SECRET,
bearer_token: process.env.TWITTER_BEARER_TOKEN,
},
queries: {
timeline: {
endpoint: "statuses/user_timeline",
params: {
screen_name: "QMUL_MAT",
include_rts: true,
exclude_replies: true,
tweet_mode: "extended",
},
},
},
},
},
I'm running gatsby 3.10.2 and gatsby-source-twitter
4.0.0 with twitter
1.7.1. Any idea what the issue might be?
Thanks!
Tom
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.