Why should we use twitter api insted of getting it from the non-api URL? - api

I was wondering if i can use the PHP library of Brandom
http://viralpatel.net/blogs/demo/Twitter.class.php.txt
Instead of using the twitter API which has rate limit.
What about using this:
http:// twitter.com/users/show/'.$id.".$format";
Instead of this:
https:// api.twitter.com/1/statuses/show/'.$id.".$format";
The 2nd one uses the API. The first one...i guess it doesn't.
So... can i use the fist one for this same purpose?
THanks.

Reasons you might want to use Twitter API:
Well documented and easy to comprehend
Proper explanation for the caught exception
Most reliable and real time results
Many dimensions to extract the data
Active community that resolves the issues(bugs, confusions ..etc). Also as the developers are Twitter guys, nothing could be more reliable as they know their product better.
Last but not the least, very easy to use
As far as "Rate Limit" is concerned, it can be dealt using Streaming API.

Related

Can I use just DirectusSDK instead of REST or GraphQL?

Are there any downsides to use directusSdk instead of making GraphQL requests?
According to documentation; My front-end can log in users and make requests through javascript SDK.
I would say using the SDK is a great option and is something I choose to do myself where possible, I believe that the Directus application uses it too, therefore it is well looked after 😌

How to call Google NLP Api from a Google Chrome extension

My aim is to select some text from a web page, start a google chrome extension and give the text to a google cloud api (Natural Language API) in my case.
I want to do some sentimental analysis and then get back the result to mark/ highlight positive sentences in green and negative ones in red.
I am new to this and do not know how to start.
The extension consists of manifest, popup etc. How should I call an API from there that does Natural Language Processing?
Should I create a Google Cloud Application with an API_KEY to call? In that case I would have to upload my credentials right?
Sorry sounds a bit confusing I know but I just don't know how I can bring this 2 things together an would be more than happy about any help
The best way to authenticate your app will depend on the specific needs and use cases of your application. You can see an overview of all the different methods here.
If you are not planning on identifying users nor on using a back end server that handles authenticating (as I assume to be your case), the best option would indeed be to use API keys. They do not identify the user, but are enough for the Natural Language APIs.
To do this you will need to create an API key for the services you want and add the necessary restrictions to make the key as secure as possible. Detailed instructions on how to do this and how to use the key in a url can be found here.
The API call could be made from within the Chrome extension with any JavaScript method capable of performing POST requests. For example using XMLHttpRequest or the Fetch API. You can find an example of the parameters that need to be included in the request here.
You may run into CORS issues when making the request directly from the extension. I recommend reading this answer, where a couple of workarounds for these issues are suggested.

Google Translate,alternatives to translation

when i'm using the google-translate website like this
https://translate.google.de/#de/en/schnell
i have the possibility to click on the suggested translation, and i can see alternatives (for example quick, fast etc.)
Is there any possiblity to get these alternatives via the API ? Or does anybody know a reliable API to get a translation for a single word with alternatives?
At the moment there is no such feature. I've filed a Feature Request to get this implemented, although there is no ETA.

i am trying to use rest api but don't understand where,why and when i should use this

What is the purpose of rest API and where it should be used how can i know that in this part of website i should use rest API any one can tell me in simple words why,where and how can in implement that technology ?
My answer might be not througout and lacking in precision, but it may do.
REST API means serving app (website) API through HTTP requests (mainly)
Thats simple/silly explanation.
Better one is here:
What exactly is RESTful programming?
About when to use it... well.. that depends.
I guess common use case is when you want to expose some part of data/functionality of your site for third party developers. Then you may define URL under which you would return data in json or xml or....

Twitter site-streams

I would like to use the twitter site-streams but I can't find a way to use them. There is no API-docs online and how to access site-streams.
Does someon have an example in php or better c#?
Are there any API-samples or a full API-doc?
Thanks
Matthias
I called oAuth before doing something similar to Shannon Whitley's user streams example. Use the curl commands generated for you at dev.twitter.com to double check your C# generate urls.
The site stream url is buried in the top middle of the doc (/2b/site.json?follow=1,2,3,4,5) # dev.twitter.com
I'd also follow #sitestreams as well to get heads up on site stream restarts.
The API looks to still be in beta, I found this. It's not a lot of detail, but the post was only a few weeks ago so it is something pretty new. It uses the same REST API that all of twitter uses so if you are familiar with that you should be able to use what it gives you.
If you need a tutorial on REST with twitter here is a decent tutorial. It is using basic authentication so I do strongly recommend that you use OAuth instead.