How to Tweet using Oauth in asp.net? - asp.net

I want to develop a feature in my project where I should be able to tweet to twitter using oauth.
I had tried using direct tweeting method as follows:
https://twitter.com/intent/tweet?text=' + text + "&url=" + encodeURIComponent("myurl");
but this requires login on each tweet.
Can anyone help me out………….

Related

How can I get tweet having only tweet ID without using twitter API?

I have a large number of Tweet IDs that have been collected by other people (https://github.com/echen102/us-pres-elections-2020), and I now want to get these tweets from those IDs. What should I do without the Twitter API?
Do you want the url ? It is : https://twitter.com/user/status/<tweet_id>
If you want the text of the tweet withou using the api , you have to render the page, and then scrape it.
You can do it with one module, requests-html:
from requests_html import HTMLSession
session = HTMLSession()
url = "https://twitter.com/user/status/1414963866304458758"
r = session.get(url)
r.html.render(sleep=2)
tweet_text = r.html.find('.css-1dbjc4n.r-1s2bzr4', first=True)
print(tweet_text.text)
Output:
Here’s a serious national security question: Why does the Biden administration want to protect COMMUNISM from blame for the Cuban Uprising? They attribute it to vaccines. Even if the Big Guy can’t comprehend it, Hunter could draw a picture for him.

how do i ger the Autorization code from linkedin API

how do i get the Authentication code, i am using below link to get this
"https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=" + apiKey + "&redirect_uri=" + REDIRECT_URL + "&state=" + STATE + "&scope=w_share";
but it keep asking me to click on Allow button, is there any way i can automate this programatically.
Thank you.
You can't do it.
If you could do it automatically without user interaction, it would mean that your application can manipulate the user's data freely without getting approval from the user.

HTTP Post: getting encrypted Paypal multiple-item cart upload button

I am having trouble using the BMCreateButton of the Button Manager API to get a multiple-item cart uploaded.
Inside the paypal documentation for the cart upload command, the paragraph on "securing your button" implies that it should be possible to get encrypted buttons for all the functions listed above, including the cart upload form. And in this SO thread, someone states they have solved this with PHP, but having looked it up, it's not evident they use a simple HTTP Post, as it's got to do with a PHP class's internal workings.
So far, I am able to only view one item only, and when trying to use the multiple-item syntax (item_name_1, item_name_2...) it's showing no items at all with a total of 0.00.
Here is my request code:
string requestContent =
"METHOD=BMCreateButton" +
"&VERSION=85.0" +
"&USER=<user>" +
"&PWD=<pwd>" +
"&SIGNATURE=<sig>" +
"&BUTTONCODE=ENCRYPTED" +
"&BUTTONTYPE=BUYNOW" +
"&BUTTONIMAGE=reg" +
"&BUTTONCOUNTRY=US" +
"&BUTTONSUBTYPE=PRODUCTS" +
//"&L_BUTTONVAR1=cmd%3D_cart" + //having this in here definitely causes an error message to display
"&L_BUTTONVAR1=button_subtype%3DPRODUCTS" +
"&L_BUTTONVAR2=business%3Dbiz%40biz.com" +
"&L_BUTTONVAR3=item_name_1%3DToaster" +
"&L_BUTTONVAR4=amount_1%3D45.00" +
"&L_BUTTONVAR5=quantity_1%3D1" +
"&L_BUTTONVAR6=upload%3D1";
It doesn't work -I have asked the PayPal tech support and will post back here if I hear anything back from them on this topic.
I encountered the same issue and as there was no progress, I contacted PayPal support. There is the answer:
There is quoted reply in case the link will die:
It's not only with ENCRYPTED. If you try CLEARTEXT, the same error is thrown.
Upload cart is a slightly different kind of button, that was never intended to be pre-built, and that's why this functionality doesn't exist in BMCreateButton. If you compare the Button Manager in the account and the API functionality - they have the same capabilities and, in both cases, the upload cart isn't there.
Looking at the documentation, you will also notice the BUTTONTYPE=CART refers to Add to cart.
It makes perfect sense to try to secure the upload cart code, but the best way will always be post-transaction consistency verification (with IPN).
So to sum this up, it is not possible to encrypt it, we can only detect tampering, e.g., with IPN.
In the reaction to my question, the PayPal moderator filed an issue to clarify this in the documentation.

Issue in Getting the tweets of whom I follow using twitter API

I am using Twitter API and Flex 4 for creating Desktop App. I need to show tweets in two parts:
1)Tweets of User ABC to be shown in one section.
2)The tweets of people whom the User ABC is following, to be shown in another section.
I achieved point 1 by using :
https://api.twitter.com/1/statuses/user_timeline.xml?&screen_name="+ usrObj.username + "&count=" + usrObj.count;
But getting Bad Authentication Error while trying for point no.2.
I am hitting the following URL using HTTPSERVICE:
https://api.twitter.com/1.1/statuses/home_timeline.json
Also, I used:
https://api.twitter.com/1/statuses/home_timeline.xml?&screen_name="+ usrObj.username + "&count=" + usrObj.count;
where usrObj is an object.
Getting the following error message:
Error #2032: Stream Error. URL: https://api.twitter.com/1.1/statuses/home_timeline.json" errorID=2032
Please let me know whether I am following proper url and queries. Can anyone suggest me as to how to get the tweets exactly?
Got my work done by using the following url for retrieving home timeline:
https://api.twitter.com/1/statuses/following_timeline.xml

How to get all users from aweber list in asp.net?

I am developing web application (using VS2010 and asp.net,c#) that gets all aweber users list. I am using following code to achieve it.
i am using this useful document. as per this document i did following things..
created account in aweber labs https://labs.aweber.com/
created "test" app
Use the "consumerKey" and "consumerSecret" code which is given by aweber team.
used following code
String consumerKey = "Afdgdfgdgfgdfll";
String consumerSecret = "zDKexfgdfgdfQqlKh5KD";
API api = new API(consumerKey, consumerSecret);
api.CallbackUrl = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/Authorize.aspx";
api.get_request_token();
HttpContext.Current.Session.Add("oauth_token", api.OAuthToken);
HttpContext.Current.Session.Add("oauth_token_secret", api.OAuthTokenSecret);
api.authorize();
i am getting null value "OAuthToken". If any solution then let me guide.
Thanks in advance. !!
Check out http://aweber.codeplex.com/
This will save you a lot of work.

Resources