Re: [twitter-dev] lists.json API call ignoring the callback parameter as of the last few hours

2011-07-08 Thread Tim Meadowcroft


On Thursday, July 7, 2011 12:45:05 AM UTC+1, themattharris wrote:
>
> This should now be fixed. Let us know if you find it isn't.
>
>
Yep - confirmed as fixed for me ... many thanks guys !

--
T

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


Re: [twitter-dev] lists.json API call ignoring the callback parameter as of the last few hours

2011-07-01 Thread Tim Meadowcroft


On Friday, July 1, 2011 7:54:00 PM UTC+1, Taylor Singletary wrote:
>
> Thanks everyone, I'll report this to the team -- not quite sure what's 
> happening.
>
> Just to set expectations, I also don't have an ETA on a fix.
>
>
Thanks - ETA not required, just one of things where filing a bug report is 
too heavywight ("add it to the prioritised list") but blind whinging feels 
like.. blind whinging.

Happy to hear it's been escalated for someone to at least have a look at 
whether it was intended or not, and it's not just me being an idiot (again).

Cheers

--
Tim

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


Re: [twitter-dev] lists.json API call ignoring the callback parameter as of the last few hours

2011-07-01 Thread Tim Meadowcroft
Glad it's not just me then !
Here's an entire curl request with headers in case that gives any clues (eg 
if it's particular hosts behind a load balancer)

Cheers

--
Tim


 curl -v 
"http://api.twitter.com/1/lists.json?callback=abc&screen_name=schmerg";
* About to connect() to api.twitter.com port 80 (#0)
*   Trying 199.59.148.87... connected
* Connected to api.twitter.com (199.59.148.87) port 80 (#0)
> GET /1/lists.json?callback=abc&screen_name=schmerg HTTP/1.1
> User-Agent: curl/7.21.4 (i686-pc-linux-gnu) libcurl/7.21.4 GnuTLS/2.10.5 
zlib/1.2.5
> Host: api.twitter.com
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Fri, 01 Jul 2011 18:28:34 GMT
< Server: hi
< Status: 200 OK
< X-Transaction: 1309544914-75829-41020
< X-RateLimit-Limit: 150
< ETag: "aab4fa3d9f5ae979ad19a12fa7fcccb0"
< X-Frame-Options: SAMEORIGIN
< Last-Modified: Fri, 01 Jul 2011 18:28:34 GMT
< X-RateLimit-Remaining: 145
< X-Runtime: 0.01157
< X-Transaction-Mask: a6183ffa5f8ca943ff1b53b5644ef114a933ec98
< Content-Type: application/json; charset=utf-8
< Content-Length: 100
< Pragma: no-cache
< X-RateLimit-Class: api
< X-Revision: DEV
< Expires: Tue, 31 Mar 1981 05:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, 
post-check=0
< X-MID: 3e1aeaa17e566ebc8a4c9b2ebcc4f1a1ebb20bbf
< X-RateLimit-Reset: 1309548219
< Set-Cookie: k=78.149.138.182.1309544914102224; path=/; expires=Fri, 
08-Jul-11 18:28:34 GMT; domain=.twitter.com
< Set-Cookie: guest_id=v1%3A130954491410552515; domain=.twitter.com; path=/; 
expires=Mon, 01 Jul 2013 06:28:34 GMT
< Set-Cookie: 
_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCLqc9eYwAToHaWQiJWU5Mjc3MmMzNjVlZTIw%250AYTkxMTZiMGI5NjBkNGIzMWNhIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--fb869e5bba31f66f478b99dc38035752adff4eaa;
 
domain=.twitter.com; path=/; HttpOnly
< Vary: Accept-Encoding
< Connection: close
< 
* Closing connection #0
{"lists":[], "next_cursor":0, "previous_cursor":0, "next_cursor_str":"0", 
"previous_cursor_str":"0"}

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] lists.json API call ignoring the callback parameter as of the last few hours

2011-07-01 Thread Tim Meadowcroft

I've been happily pulling back a user's lists with a query like

  http://api.twitter.com/1/lists.json?callback=abc&screen_name=schmerg

but suddenly (sometime in the last 24 hours I suspect) this is returning 
pure json, not jsonp.. that is

  {"lists":[], "next_cursor":0, "previous_cursor":0, "next_cursor_str":"0", 
"previous_cursor_str":"0"}

rather than 

abc({"lists":[], "next_cursor":0, "previous_cursor":0, 
"next_cursor_str":"0", "previous_cursor_str":"0"})

which if course breaks me loading it in a script tag.

Other calls seem to still be respecting the callback parameter... any idea 
what might have changed ??

--
Tim

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: Filtering tweets in the profile widget

2011-06-29 Thread Tim Meadowcroft

On Wednesday, June 29, 2011 6:56:52 PM UTC+1, jcorso wrote:
>
> I am using a the Twitter widget in 'profile' mode to display news and 
> events on my website.  (Twitter user is @ProfJasonCorso and the url is 
> http://www.cse.buffalo.edu/~jcorso)  However, I would like to filter 
> the tweets that are displayed in the widget to only those containing 
> the hashtags #news or #events.  I cannot figure out how to use the 
> 'filters' feature of the widget (even after reading the widget.js with 
> my somewhat outdated knowledge of javascript) and cannot find any 
> documentation or examples about it.  Nor can I find another way of 
> doing it. 
>
>
The basic "test it out" pages at http://twitter.com/about/resources/widgets 
are handy for trying out various features, and will then show the code you 
need.
And I take it you've got the documented un-minified source of the widget 
code from 

  http://twitter.com/javascripts/widgets/widget.js

to look at .
 

> Note, I think the 'profile' mode is appropriate rather than the 
> 'search' mode because I believe Twitter only indexes recent tweets for 
> search and I need all of them to appear. 
>

The setUser() call seems to call setSearch(" "), so if you want to 
experiment combining them, I'd do something like

  w.setUser('ProfJasonCorso').setSearch("#news").start()
 
but personally, I use the REST API to pull in the tweets and then filter 
them as I want, and then poke beneath the covers of the widget to give it a 
list of tweets to display (rather than letting it fetch them itself).

So if you want to look at that as an option, the way you can do it with the 
current widget code is to call

  w._prePlay(tweets);
  w._play();

instead of start()

--
Tim

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


Re: [twitter-dev] Twitter widgets not using entities to present t.co links

2011-06-24 Thread Tim Meadowcroft

Thanks Matt, filed as a feature request rather than a defect

   http://code.google.com/p/twitter-api/issues/detail?id=2250

--
T

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: Unwanted T.CO shortening

2011-06-11 Thread Tim Meadowcroft


On Saturday, June 11, 2011 1:23:47 PM UTC+1, Adam Green wrote:
>
> I believe that at least part of Twitter's motivation is based on 
> protecting users from spam and viruses. In that case, why not 
> implement some purging alogrithms? Here's an easy one. If an account 
> follows nobody and only sends emails with a screen name and URL, it is 
> probably a spammer and the URLs are probably bad news for anyone who 
> clicks them. 


Far from being easy - that's exactly the sort of pattern that twitter has 
come to realise they can't automatically classify as spam as it's exactly 
the model of usage to get news out in oppressive regimes (esp the "arab 
spring" of last 6-9 months). Imagine you've just seen the army roll in and 
start a massacre of civilians, you take a few photos, post them somewhere 
like a dropbox account with a short cry for help, set up a twitter account 
and rapidly post the url to a load of people outside the event - 
journalists, activists etc (note that you set up a new account so that it 
can't be traced to you should the army or secret police or whoever get hold 
of it). This model of rapid anonymous dissemination of breaking news is a 
major part of what makes twitter what it is  - maybe not to all of us, but 
it's a key model that they want to foster.

So what twitter do instead is wrap the link in a t.co link and expand it 
again when people view the tweet.. they can then examine the url after the 
event (ie a few seconds or a few minutes later) and if it turns out to be 
spam, disable the t.co link (so anyone clicking on it after that point will 
not be sent to the pointed at site).

If you look it up you can find interviews with the twitter spam team where 
they explain this.

--
T


 

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: @Anywhere Login Timeouts

2011-06-08 Thread Tim Meadowcroft
While looking at localStorage in the browser, I noticed that when I connect 
with @anywhere various details are written to localStorage for my page 
including

  twitter_anywhere_cache_["account/verify_credentials",[]]_expiry: 
1307546741323
  twttr_anywhere_expiry: 1307552140184

which if interpreted as javascript Dates correspond to 30 minutes and 2 
hours (respectively) after my connect time - that is 1800 * 000 and 7200 * 
1000 ms.

I haven't tried playing with them, but remembering that @anywhere is still 
largely experimental and undocumented, those keys might give you some thing 
to look for in the code and see if you can spot anything that looks like a 
valid way to tweak them.
.

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


Re: [twitter-dev] Re: Why is there no @Anywhere version of the Tweet Button with Count?

2011-06-08 Thread Tim Meadowcroft
He was maybe thinking of a response to a similar question on another thread.

The way the tweet and follow buttons are done has changed. If you want to 
create a button after widgets.js has been loaded (any sort of dynamic use), 
then you're supposed to do this by adding an iframe with appropriate url and 
parameters and it will return code that creates the button

http://platform.twitter.com/widgets/follow_button.html?screen_name=twitterapi&show_count=
true"
  style="width:300px; height:20px;">

See
  http://dev.twitter.com/pages/follow_button#using-an-iframe
  
http://dev.twitter.com/pages/follow_button#how-can-i-render-the-follow-button-in-ajax-loaded-content
  http://dev.twitter.com/pages/tweet_button

--
T

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: t.co?

2011-06-05 Thread Tim Meadowcroft

The point of t.co, as I understand it, is twitter's very different dynamic 
with regards to spam.

Consider a scenario: someone creates a new account, sends one message with 
@mentions of 5 high profile people, almost no text, but an http ref (perhaps 
wrapped behind a shortener, maybe not).

In the world of email, this would skew towards a "spam" rating, in the 
twitter world this may be someone in an oppressed regime getting a desperate 
message out - twitter's vision is to facilitate such messages without 
leaving the door open to abuse.

So rather than block the message (unlike email, this is close-to-real-time) 
they wrap the href in a t.co reference that THEY control and publish the 
message. If the "real" link turns out to be spam or malice or gratuitous 
nonsense, they can, at any point after "publishing" the message, simply 
redirect the t.co reference they've allocated, otherwise they leave it in 
place.

When you look at t.co from this point of view, I believe it makes sense - 
you may or may not agree with the technique but I believe it's not some kind 
of land-grab for complete control, but quite a smart and considered approach 
to the trade-offs inherent in their service.

There are interviews with their spam people that explain this in more detail 
if you search for them

--
T



-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: Reducing rate-limited calls to friends/ids

2011-05-19 Thread Tim Meadowcroft

Apologies to the forum if this is considered bad form but there are sources 
other than the Twitter API to find out who follows who on Twitter, so you 
could search for the tweets using the Twitter API, assemble a list of users, 
and then call another service to find out who follows who. You're then at 
the mercy of some other service being up to date and operational, but it 
works at the moment.

@themattharris - I don't want to offend you guys so I won't name the 
solution I'm thinking of unless you say it's OK to do so here.

--
Tim

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: Twitter Profile Widget Change Header Text

2011-05-12 Thread Tim Meadowcroft

Personally I read the full source to see what's going on, and then figure 
out how to work around bits of it, so for example I might see when the 
header title is set and the selectors used, and then use its own routines to 
modify them (eg  hdr = widget.byClass("twtr-hd", "div") and then manipulate 
the DOM myself) rather than use a modified version of the widget js file 
itself.

This way it's easier for me to keep up with changes to the widgets (eg the 
recent addition of intents) and to ensure I'm staying within the rules about 
presenting twitter content (logos, names, etc), but YMMV

--
T

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: Twitter Profile Widget Change Header Text

2011-05-11 Thread Tim Meadowcroft

If the standard widget code (http://twitter.com/widgets) is what you're 
looking at then I should point out

 * Author: Dustin Diaz (dus...@twitter.com)
 * For full documented source see 
http://twitter.com/javascripts/widgets/widget.js
 * Hosting and modifications of the original source IS allowed.

Reading the full documented source is quite useful  I use it to figure 
out how to slightly subvert the official widget code

--
T

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: What does tweet id means?

2011-04-20 Thread Tim Meadowcroft

I think you can only really rely on IDs having different values.

In general, at the moment with Twitter, you could assume they increase over 
time, but (and I don't work for Twitter) typically ID allocation on large 
multihost systems don't work by allocating strictly sequential IDs without 
gaps - it's too hard to sequence and not really necessary.

So, for example, one way is that you build a system that gives different 
ID-assigning-hosts small blocks of IDs that they can use so they can 
allocate a series of IDs knowing they're unique without having to take out 
any kind of global lock (they only take the lock to ask for a new block 
every now and then). Another approach might be to have clocks synchronised 
to some known accuracy and have IDs calculated as "period-since-epoch * 
some-suitable-multiplier + unique-offset-per-host + 
incrementing-counter-for-this-host". 

I'm sure people can come up with other schemes as quick as we could type 
them up, but in general you make your ID space many orders of magnitude 
bigger than you strictly need, and in return you gain some flexibility in 
the criteria needed for quick and cheap unique allocation in a distributed 
system. But I wouldn't assume that every possible ID value is necessarily 
allocated.

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: How to get the number of pages in user's timeline

2011-04-19 Thread Tim Meadowcroft
I'm pretty sure all tweet IDs are in a single global ordering, so "1 week 
ago" is the same numerical ID (for the since_id) param for every user 
account.

So you could post a single tweet (or similar) every day and use this to 
build a "date to ID" mapping over time... then you'll know an ID to use to 
indicate "1 week ago" for any given date past when you started (and it's 
pretty simple to build a historical table) - then you can experiment with 
using the user/timeline API with "since_id" (and "max_id" too if needed)

Don't know for sure it would work, but from what you've explained so far, 
that's the sort of thing I'd experiment with first...

--
T

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: How to get the number of pages in user's timeline

2011-04-16 Thread Tim Meadowcroft

The users/show API includes a "statuses_count" field which tells you how 
many tweets the user has posted

  http://dev.twitter.com/doc/get/users/show


-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: need twitter spam for a research project

2011-04-10 Thread Tim Meadowcroft


On Monday, April 4, 2011 2:19:38 AM UTC+1, Jeff Tucker wrote:
>
> Unfortunately (I can't believe that I'm writing this) I am having a 
> hard time getting spammers to actually spam me.  Is there any way that 
> I can somehow get access to the tweets of several dozen spam accounts 
> (prior to when they're shut down) so that I can see what they're 
> posting?  Is this possible somehow? 
>
>
I'd suggest, at the moment, to post any tweet with the word "ipad" in it, 
and I'd be surprised if you  didn't get spammed within a couple of minutes.

The bad news, perhaps, from your project's point of view is that I was 
spammed (after a similar post) from a brand new account - no followers, 
following no one, first tweet (and presumably never used again).

As the article below points out, twitter does not want to start blocking 
people as spammers based on those sorts of characteristics but, I believe, 
are instead looking at doing things like replacing all links with their own 
url-shortener service and then checking the link, and if it turns out to be 
spammy then they can simply turn off their entry for the link and so block 
any traffic for the spammer.

Anyway here's the article

 http://www.guardian.co.uk/technology/2011/apr/07/twitter-internet

Quite an interesting read IMHO...

--
T

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: GET :user/lists/:id/statuses stopped working

2011-04-01 Thread Tim Meadowcroft

The twitter widget used to call the old address, but a new version was 
posted a couple of days ago (without incrementing the version number in the 
comment at the top) that construct URLs of the 2nd form... guess they 
standardised this and I'm pretty sure it changed over only in the last week 
or so.

Line 844 of the documented source changed from
  var listBase = http + domain + '/';
to
  var listBase = http + 'api.' + domain + '/1/';

What can be annoying is that Google Chrome incorrectly is overly aggressive 
about caching dynamically loaded javascript files (see 
http://code.google.com/p/chromium/issues/detail?id=37711) , so for some 
Chrome users list widgets won't display properly since the change unless you 
explicitly add a cache-buster or similar (yeah, spent an hour trying to 
figure what I'd done wrong just this morning)

--
T

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: TWTR widget callback

2011-04-01 Thread Tim Meadowcroft

You can look at the full documented source 

  http://twitter.com/javascripts/widgets/widget.js

and could add that facility of you want ("Hosting and modifications of the 
original source IS allowed."), but there is a simpler way that you can see 
by inspecting the documented code...

First render a div with a known id

  

and then render the widget to that id

 TWTR.Widget({
id: 'myTwitterWidget',
   ... other params here...
  }).render()

and that way, the widget wipes my loader when it renders (ie if you specify 
an id, the widget will replace the existing contents of that element)

Cheers

--
Tim


-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: Does anyone has Javascript function to convert date into twitter time format

2011-04-01 Thread Tim Meadowcroft
If you pull the full documented source for the rather excellent twitter 
widgets (http://twitter.com/widgets), you'll find exactly the routine to do 
this.

/**
  * relative time calculator
  * @param {string} twitter date string returned from Twitter API
  * @return {string} relative time like "2 minutes ago"
  */
var timeAgo = function(dateString) {
  

The file has a large comment at the top 

 * For full documented source see 
http://twitter.com/javascripts/widgets/widget.js
 * Hosting and modifications of the original source IS allowed.

It also contains gems such as the "Twitalinkahashifyer" - handy routines for 
linking "@user" and the like

--
Tim

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk