Twitter Button not counting tweets when query string added - twitter

This page has a few tweets counted for it:
http://development-area.com/stackoverflow/
however, as soon as I add a query string, the count goes to zero.
http://development-area.com/stackoverflow/?omg=lolz
Can anyone see why this might be happening?

Ok found it. I simply have to add the data-counturl attribute and hard code the URL, instead of relying on the page URL.

Related

Google Place search API with pageToken returns same record

I'm listing out restaurants, bars and pubs near by I used "pageToken" as I need more place records.
I faced two issues as
1 My URL is not accepting | 'pipeline' symbol.
I tried encoding URL but its not working so Just encode | as "%7C" is this correct way?
2 I just tied to list outs only restaurant and use next_page_token while calling next time the API to load more records.
My URL is something like
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=19.0176147,72.8561644&rankby=distance&type=restaurant&key=[MY_APP_KEY]&pageToken=CpQCCQEAAPqnEctK9cCPZtPWY8NnnBSyzCwsmO_MsTZBaIUeEkO6g_7rsw97tY-bMsBY0d0Rjw61zD-Peaos4wMVZTe7TrZhB-GVfpr6ya847qB0t1C_2Qgxe3Abur1YmRW_fop0Ro5bwIkxOjMI2Gh19D1IYGPOZ7qqv1oM3B7P4lHZ59yFwXEhMbMZUvQSiuVyoDKQ-FXQB9FMCGkGkbllH9ZzIm-38_XG4ZsFMOYKHhdhp3hkCiLVc8SwLO01t-Bq1emptTQfHUUtXXcCWEFCFClpkJlw0rRnW2fRXuxEy25nFZlqrNxHgcifA6v_xq7Jfb5J5FDTCT4FSurAa1MUXYCPW3fPri-7n9CpZwzZDp7wUOUPEhBByQSF6FAegW_gFyc4Q9PqGhSqewBPNa7pLMTWLFJR94IfhPPqpg
But its returning same records on every request, I have verified that pageToken is getting changed in every request.
Can you please let me know where I made mistake?
You are passing wrong key pageToken. Change it to pagetoken and it will work.
Please refer this link for further information: https://developers.google.com/places/web-service/search

Advantages to randomizing an order status URL?

Is there an advantage in randomizing the URL for order statuses?
Right now, the URL is based on an incrementing order number, like blah.com/orderstatus/1, blah.com/orderstatus/2 and only the user is able to see his own order. If he tries to look at somebody else's order by changing the number in the url, he will receive an error.
Are there any disadvantages of doing this?
Doing this is good, in fact almost every website use index like that.
Using a random index will make it very complicated, and is absolutely not recommended.

Twitter: Number of tweets OR get more tweets

I would like to know how can I get all tweets from a certain hash tag?
I am currently using the following code:
xhr.open("GET","http://search.twitter.com/search.json?q=%23PrayForJapan");
This only returns me 15 tweets. Does anyone know how to make it return more?
Also, I have got a code to get me the tweets of a certain screen name, this only returns 20 tweets, how can i ask the following 20 tweets?
The code i used for that is:
xhr.open("GET","http://api.twitter.com/1/statuses/user_timeline.json?screen_name=Eminem");
I'm using titanium to create this, but I don't think that is an issue?
Thanks!
You can usually add count=x as parameter to the query string to get up to x tweets (for the search api it seems to be rpp). Query string parameters are added to the base url via ? and each individual parameter is then separated by & as in http://api?user=1&count=4
Most of the time, it is better though to remember the last tweets and then add ?since_id=x as this way you only get tweets you did not see before.
Have a look at the api documentation.

twitter: share link with parameters

I have a share button on my site.
But I need to share link with parameters, and each time parameters will be different (I need to track user who is sharing, etc.)
For example need to share link like http://mySite.com/page?userId=111&someParam=222
I can share this well, but how can I force count to work correct?
if I set
data-url="http://mySite.com/page?userId=111&someParam=222"
data-counturl="http://mySite.com/page/"
I am getting count 0 always. How to get this work?
From http://dev.twitter.com/pages/tweet_button,
"The count box shows how many times the URL has been Tweeted."
Your problem is you simply have the url and counturl mixed up. Change url to the short one, for display purposes - that's the one people will see. Use the counturl for the one with all the parameters, to ensure they go to the right place with the parameters intact.
I suspect the reason your count kept showing zero tweets is because you have a different (unique) url as your primary url each time it is tweeted, so each tweet is the first time that url (including its parameters) was shared.
Twitter now lets you send the url through data attributes. This works perfectly for me and should work for you out of the box!
The button (check out data-url):
Tweet
The twitter javascript snippet (from https://dev.twitter.com/docs/tweet-button)
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Twitter API - Display all tweets with a certain hashtag?

How would I go about displaying tweets that contain a certain hashtag using the Twitter API? Thanks
I'd also like to know if there is a way to get all tweets from a certain hashtag in a separate file, also the ones that don't show up in your feed anymore. I suppose that's what the earlier question was about, too.
This answer was written in 2010. The API it uses has since been retired. It is kept for historical interest only.
Search for it.
Make sure include_entities is set to true to get hashtag results. See Tweet Entities
Returns 5 mixed results with Twitter.com user IDs plus entities for the term "blue angels":
GET http://search.twitter.com/search.json?q=blue%20angels&rpp=5&include_entities=true&with_twitter_user_id=true&result_type=mixed
UPDATE for v1.1:
Rather than giving q="search_string" give it q="hashtag" in URL encoded form to return results with HASHTAG ONLY. So your query would become:
GET https://api.twitter.com/1.1/search/tweets.json?q=%23freebandnames
%23 is URL encoded form of #. Try the link out in your browser and it should work.
You can optimize the query by adding since_id and max_id parameters detailed here. Hope this helps !
Note: Search API is now a OAUTH authenticated call, so please include your access_tokens to the above call
Updated
Twitter Search doc link:
https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
The answer here worked better for me as it isolates the search on the hashtag, not just returning results that contain the search string. In the answer above you would still need to parse the JSON response to see if the entities.hashtags array is not empty.

Resources