Get location information from twitter using processing - java

I'm trying to write a program in processing that can get a location from the user who is using Twitter. In every twitter profile there is information where they live like "New York, NY". I figuered out that I will need to use Twitter4J to do this, but what im really asking, is it possible to get a users location from their profile? or is it limited to only induvidual tweets?
I don't expect a full code as an answer but if somebody can point me in the right direction it would be great!

I can suggest also using
https://github.com/fernandezpablo85/scribe-java
for OAuth integration (very easy to integrate and extend) and then load user profile.
twitter user profile contains all details, including user's location, see example below
...
"location":"Oslo, Norway"
,"geo_enabled":true
...
see twitter api -> https://dev.twitter.com/docs/api/1/get/users/show

Related

How can i enable google direction api for my project?

i dont have valid account for payment since i am from nepal. is that compulsory to create "Credentials" in order to use google direction api? help me
yes it is compulsory to create credentials because using this you will set where and how you can use your google api key. And connection of payment account will also be necessary for this.
If you are not able to use Google Maps in your app, try Mapbox, everything is free and is also has its own directions api.

Is there a way to restore recently-deleted user using Java from Azure AD?

Title I guess is self explanatory.
I haven't tried anything yet as I haven't seen a sample approach from Microsoft.
The end result should be that when I go to Azure portal and go to Active directory, the user deleted will be back in the Active Users list (Removed from "Deleted Users").
Thanks!
You can use Microsoft Graph SDK for Java to do this.
graphClient.directory().deletedItems("{deletedItemId}").restore();
Or you can call graph api directly.
POST /directory/deletedItems/{id}/restore

YouTube Data API v3 quota exceeded on the first upload

I am trying to develop a desktop application in Java for uploading videos. I create a new Google account, create project on developer console and create credentials (ClientID and ClientSecret). After creating all of these, i do authorization (as in java examples), the application opens browser window for me to allow the application to manage the channel, and everything works fine.
But when i try to upload a video (short video, tried it on other channels before and it uploaded every time), i immediately get quota exceeded response. And in the developer console i can see that quota is actually exceeded (9644 queries already). I must add that this is happening only for the newly registered accounts - the same video uploads without issues using the same app.
Why is this happening? Is there any way I can "register" new account and immediately do upload? If not, how can I do this properly? Thanks
I had a similar problem with the python code that i used (i modified code based on https://developers.google.com/youtube/v3/guides/uploading_a_video). I solved it using the following workflow:
create a (new) google account if you dont have one yet
go to youtube, sign up with the google account and create a channel
go to
https://console.developers.google.com/apis/credentials?pli=1
create a project, pick a name
click on OAuth consent screen, pick external, pick application name
go back to Credentials, create Credentials using OAuthClient ID, pick Web application
pick a name, put into redirect urls: http://localhost:8080/ and https://developers.google.com/oauthplayground and save
go to Dashboard, search YouTube Data API v3 and enable
then go to https://developers.google.com/oauthplayground/
click on the rack wheel on the right, click use your own credentials, copy and past clientID and secret client from https://console.developers.google.com/apis/credentials and close
search for Youtube Data API v3 on the left, and select https://www.googleapis.com/auth/youtube.upload and https://www.googleapis.com/auth/youtube
click authorize APIs, log into your account, agree to all questions asked
Click Exchange authorization code for token
the Request on the right should not give you any errors
go back to https://console.developers.google.com/apis/credentials, when you click on the edit button next to your credentials, you should be able to download your JSON files. put them into the script folder under client_secrets.json
make sure to delete the file python_upload_video.py-oauth2.json from previous trys
when running the code with for example
python upload_video.py --file="input.mp4" --privacyStatus="unlisted"
the browser should open and ask you to log into your account
what i noticed is that:
if you get three errors in three hours it seems to exceed the quota and you cannot continue
the upload works for about 5 videos a day. If you need to upload more and cannot wait the only way is to create a new account and repeat the steps above (as far as I know)
It may be worth investigating further: I guess that your issue has to do with the API issues seen since about three days now. See the answer https://stackoverflow.com/a/55220182/8327971; also Google's known and acknowledged issue: https://issuetracker.google.com/issues/128673552.

Get Facebook Username using Windows Azure

Hereis my problem,
I make an Android application and i use Windows Azure.
I use Azure to make login activity with Facebook. It works well i can log in.
However i want to get the Name and last name of the guy who log in using Facebook.
I have no idea how to do it using windows azure, i check this web site http://blogs.msdn.com/b/carlosfigueira/archive/2012/10/25/getting-user-information-on-azure-mobile-services.aspx
But i don't understand it. Anyone got an idea on how to get the name and last name of the person who log in using windows azure on android ?
To get user's information from facebook, first User must authorize it. Second, you need to query this information using graphs api from facebook.
Here some tutorials that could help you:
http://blogs.msdn.com/b/carlosfigueira/archive/2012/10/25/getting-user-information-on-azure-mobile-services.aspx
http://chrisrisner.com/Authentication-with-Windows-Azure-Mobile-Services
https://developers.facebook.com/docs/android/getting-started/

reading logs in google app engine

after launching your app on google app engine.
you can use the 'logs' page in the admin console to see a how many requests were made,
any http:// 404 errors etc.
It's hard to make sense of how many visitors you really got and or others.
Am I missing something here ?
Can somebody tell me how to read logs on a google app engine.
Many Thanks
The logs are not meant to control site visits. For that you should use google analytics.
You can download request logs in Apache log format using the appcfg tool.
In essence, google kinda expects you to use Google Analytics (being it their tool :-) )
What you could do however, is add some kind of loggin, where you'd simply write to a text-file, or call some kind of webservice that would do it for you.
Cheers

Categories