Closed normidar closed 1 year ago
Thanks for your contribution! :)
it like a v1 API:
I think I can use http package.
get the id and create a GeoParam.
Hi @normidar ,
Geo-related v2 endpoints are not officially supported, so this package also does not currently support endpoints that manipulate them either.
Well, as we can read from the name, this package supports only v2 endpoints. I made an exception and implemented Media using the v1 endpoint because official Twitter will not support this high demand v2 endpoint anytime soon.
So, this package has a flexible structure that can accommodate even v1 endpoints, of course :) I can also implement and release it using v1 endpoints if there is a demand for it :)
However, please keep note that destructive changes may occur when the v2 endpoint, the actual successor to this v1 endpoint, is officially released.
@all-contributors please add @normidar for ideas
@myConsciousness
I've put up a pull request to add @normidar! :tada:
@myConsciousness
So, this package has a flexible structure that can accommodate even v1 endpoints, of course :) I can also implement and release it using v1 endpoints if there is a demand for it :)
It sounds good, how long will it take? before that, I think will use the v1 by REST Get.
it is difficult to authenticate the HTTP access for me. I will wait for your work.
Hi @normidar ,
I have already completed the implementation of these endpoints, so I will release it as soon as testing is completed, maybe it's in 2 days or less :)
Please see #578 also!
Hi @normidar ,
v4.5.0 with Geo service support has been released :) You can search for places as follows.
import 'package:twitter_api_v2/twitter_api_v2.dart' as v2;
Future<void> main() async {
final twitter = v2.TwitterApi(
bearerToken: 'YOUR_TOKEN_HERE',
//! OAuth 1.0a tokens are required for v1.1 endpoint.
oauthTokens: v2.OAuthTokens(
consumerKey: 'CONSUMER_KEY',
consumerSecret: 'CONSUMER_KEY_SECRET',
accessToken: 'ACCESS_TOKEN',
accessTokenSecret: 'ACCESS_TOKEN_SECRET',
),
);
try {
final response = await twitter.geo.searchLocations(
query: 'Tokyo',
);
print(response);
print(response.data.first.id);
} on v2.TwitterException catch (e) {
print(e);
}
}
And you can lookup a specific place data by place id.
import 'package:twitter_api_v2/twitter_api_v2.dart' as v2;
Future<void> main() async {
final twitter = v2.TwitterApi(
bearerToken: 'YOUR_TOKEN_HERE',
//! OAuth 1.0a tokens are required for v1.1 endpoint.
oauthTokens: v2.OAuthTokens(
consumerKey: 'CONSUMER_KEY',
consumerSecret: 'CONSUMER_KEY_SECRET',
accessToken: 'ACCESS_TOKEN',
accessTokenSecret: 'ACCESS_TOKEN_SECRET',
),
);
try {
final response = await twitter.geo.lookupById(
placeId: '1234',
);
print(response);
print(response.data.id);
} on v2.TwitterException catch (e) {
print(e);
}
}
Fixed #581
@myConsciousness
Thanks for your work.
Can I use /1.1/geo/reverse_geocode
here?
I am trying
final res = await api.geo.searchLocations(
granularity: GeoGranularity.neighborhood,
latitude:****,
longitude: ******,
);
but I got
[埼玉 所沢市, 埼玉 川越市, 埼玉 さいたま市 大宮区,....
It is too broad, I just want to search for the store that is near me.
@myConsciousness If you do not mind, I think I can try to create a PR for this.
1. Problem to solve
Get nearby location information。
how to use this API: https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/overview
2. Proposal
3. More information