tumblr-api

Legrégebbi, ma is aktív, magyar tumblik listája

Kérdezték tőlem, szóval itt van: elvileg ők a legrégebbi, ma is aktív, magyar tumblik, a legelső posztjuk linkével együtt:

Playing with Tumblr API

1. Install Ouath2
2. Install Pytumblr
3. Register an Application
https://www.tumblr.com/oauth/apps
4. Go to the application and get your ouath2 credentials
5. Enter your credentials in your python file

client = pytumblr.TumblrRestClient(
   ’<consumer_key>’,
   ’<consumer_secret>’,
   ’<oauth_token>’,
   ’<oauth_secret>’,
)

6.  To get name and title of all blogs you are following

off =0
while True:
   my_dict = client.following(offset =off)
   res = my_dict[‘blogs’]
   for rs in res:
       print(rs['name’] + “….” + rs['title’])
  
   off+=20

6. Number of posts liked for each blog

off =0
like_dict= {}
while True:
   my_dict = client.blog_likes('conflatedthought.tumblr.com’,offset =off)
   res = my_dict['liked_posts’]
   for rs in res:
       strs = str(rs['tags’]).strip(’[]’)
       #print(rs['blog_name’] +“ ”+ strs)
       #print(“..”)
       if rs['blog_name’] in like_dict.keys():
           like_dict[rs['blog_name’]] += 1
           #print rs['blog_name’] +“  ” + str(like_dict[rs['blog_name’]])
       else:
           like_dict[rs['blog_name’]] = 1    

   off+=20
for the_key, the_value in like_dict.iteritems():
   print the_key, 'corresponds to’, the_value

7.  Sample Output

sportspage….Sports Page
themobilemovement….The Mobile Movement
adidasfootball….adidas Football
instagram-engineering….Instagram Engineering
soccerdotcom….SOCCER.COM
sony….Sony on Tumblr
yahoolabs….Yahoo Labs
taylorswift….Taylor Swift
beyonce….Beyoncé | I Am
itscalledfutbol….Did someone say “futbol”?
futbolarte….Futbol Arte
fcyahoo….FC Yahoo
yahooscreen….Yahoo Screen
yahoo….Yahoo
engineering….Tumblr Engineering
yahoodevelopers….Yahoo Developer Network
mongodb….The MongoDB Community Blog
yahooeng….Yahoo Engineering
marissamayr….Marissa’s Tumblr
staff….Tumblr Staff
whoagurt….Whoagurt
narendra-modi….Narendra Modi
nytvideo….New York Times Video
bonjovi-is-my-life….Bon Jovi♥ Is My Life
etsy….Etsy
game-of-thrones….You win or you die.
seinfeld….Seinfeld
itunes….iTunes
gameofthrones….Game of Thrones: Cast A Large Shadow
forzaibra….Forza Ibra

Tumblr Stalker Script(bit.ly/1RuWXvE)

Script is here: bit.ly/1RuWXvE

I was playing around with the tumblr API trying to find interesting things to do with it. I quickly came up with something that actually proved to be useful.

When you run into a blog with lots of text posts lots of them are uninteresting. However, between the uninteresting heap of bullshit….There….lies…..a juicy post. So, save your self the time and the money (because time is money) and use this keyword searcher for the text posts of a blog. Simply use the instructions in the script (It might very well be poorly written I did it fast and I haven’t coded python in quite a while…Don’t care. Does its job :) ).

It turns out there are a TON of Daft Punk fans on Tumblr, posting some awesome images and GIFs. As an homage to all of you and this well-anticipated release, New Division Digital put everything together in one full-screen experience. Check out randomaccessdj.com. It plays all the posts for you, or let’s you DJ them yourself, while you listen to Random Access Memories on Spotify. 

Everything is based on the APIs that Tumblr and Spotify provide.

Perhaps this brings the old CD jacket artwork to a new level? 

Enjoy the dance party.

tumblr.js JavaScript client

Today I’m excited to announce the release of tumblr.js, the first of several official API clients we’ll be rolling out over the next few months.

You can install it now with npm, and start making something awesome:

var tumblr = require('tumblr.js');
var client = tumblr.createClient({
  consumer_key: 'consumer_key',
  consumer_secret: 'consumer_secret',
  token: 'oauth_token',
  token_secret: 'oauth_token_secret'
});

// Name all of the authenticating user's blogs
client.userInfo(function (err, data) {
  data.user.blogs.forEach(function (blog) {
    console.log(blog.name);
  });
});

It comes with full support for all of the API V2 endpoints including tag search, following, liking, and post creation. For more detail, see the GitHub page.

More to come soon!

Great Success With Tumblr API

Alright, so sometime in the early-ish morning I managed to get the Twitter API pulling in the latest blog post as the the front-page copy for the Guardians of the City website.

I also then hooked up our MongoDB and created a cache of the Tumblr blog posts and setup a system where a request for the Tumblr data will retrieve from the API only after a certain update interval has passed.  I’m planning to move to a background process which updates each API DB cache based on the rate at which it has new data.

Anyways, this whole post is actually just another test to make sure that the cache will eventually pull in this new content after the update interval.  We’ll see if I ever get to elaborating on this stuff with code… I’m sure eventually…

- G

Hey all,

I’m happy to announce the release of the 0.8.0 version of our tumblr_client gem! This release is a major bump from our 0.7.5 release! An important update is the deprecation of the :raw_data parameter for posting. If you need this parameter do not update past 0.7.5.

Changelog

  • Removing support for :raw_data parameter for posting
  • Adding support for multipart file uploading
  • Removing all custom OAuth code and letting better tested libraries take care of it for us!
  • Allowing you to configure any of your favorite ruby HTTP clients supported by Faraday!

And if you have any issues, let me know here or @codingjester on Twitter or report issues directly here.

Get hacking everyone! 

ChangeLog for the Week of 11/09/12

This week, we are excited to bring a new feature to the API: the ability to consume a user’s likes if they have been made public in their Settings.

Here’s an example request:

http://api.tumblr.com/v2/blog/codingjester.tumblr.com/likes?api_key=your_key

You’ll receive a payload of Post objects that have been liked by that user. If you attempt to access a blog that has not shared their likes, you will get our standard 401.

This could become a guessing game on which blog have support the access of their likes. To prevent this, we’ve added a new field: share_likes to the blog object, accessible from the /info and the /user/info routes.

Lets look at an example payload from the /info route.

Please check out the latest documentation for any further details. As always, our Ask box is always open for feedback and questions!

Changes on Lensblr

As some of you have already noticed, there are some changes on Lensblr such as our URL, layout and Photo Submissions page. We are no longer using our proprietary software and have scaled back publishing work primarily due to technical difficulties that is caused by Tumblr continually updating their api. We no longer have the resources to maintain the software due to the changes and as such have scaled back. 

We still support the photographic community on Tumblr although in a different way then we have in the past, now more in line with other similar sites.

We are so pleased we still can bring the work of the real creators on Tumblr to more eyes every day! 

Thank you for your support.

Lensblr Staff

Bee glue: Honey bee (Apis mellifera), using its hind leg to collect the dark resinous sap oozing from a scarred mesquite tree. At the Rio Salado Habitat Restoration Area, in Phoenix Arizona. 

The sticky goo, called propolis, is used by bees to patch hives or seal off unused entrances. It is used by people (who steal collect it from domesticated bees) in a variety of folk remedies, and in varnishes for string musical instruments. 

Bonus etymology: Propolis is a transliteration of the Ancient Greek πρόπολις, meaning suburb. It was applied to the bees’ gooey glue because of their apparent use of the material to extend their hives. 

As I explained in earlier posts, I used the Tumblr API to scrape about 400,000 anonymous asks, and I’ve been using them to train neural networks.

I initially tried feeding it only the asks less than 150 characters in length, which accounts for about 70% of them (although I don’t remember the exact number). I didn’t attempt to filter out non-English asks; the great majority are in English, and those that langdetect identified as non-English are often false negatives.

Certain subjects tend to come up a lot in the output:

would you eat a young and nerd? :3 ? ?

Hi, Can you please reserve Taylor books or sexual times?

What is your favorite sex?

how do you know how to make your hair related?

I feel you so much having sex, I was wondering if you could convince a hug? I thought you were dating you

I feel like I am so sorry to hurt her, just wanted to try to suck and see if you were glad… really hard to know… please?

Have you ever had a worse for Benedict Spunk Personality? Or like a fan of England is a best friend?

What languages do you have for your birthday?

How do I go on your bed at all?

You’ve had a man and I don’t know you because your eyes are so cute!

Is this a legacy to your blog?

I like the chair more…

I have a selfie with you and your blog is so cute and i love you

“Oh, and the Terf playing Lucifer in the world”.

I SHIP IT

hi sorry if this is going to be a mental sex and awesome person in your blog with “piece of flowers”

Where do you get this blog from a little black hair??

I want to send you some sense of the kissing imploding

I was wondering what you do with your blog?

you are gonna get into the fucker and also how do they start it

What does that they wanted to kiss a lot to do it. (sorry if you had to make a legal and you should go on that? what happens is going to be a body)

Are you going to be a good one? What do you think of the dead face?

Why is the Network?

What was ur day to cuddle?

who do you want to change the stars?

What is the answer to you?

SON YOUR FACE

Tumblr Maintenance - Saturday October 6th 2012

Tumblr will be performing maintenance Saturday, October 6th 2012, meaning the API will not be returning expected values (please see official notice here). We wanted to make sure that developers understand what the API will be returning during this time.

The API will be returning a 503 status code (Service Unavailable) with an accompanied JSON payload. An example can be found below:

{ "meta" : { "status" : 503, "msg" : "Service Unavailable"}, "response" : "Tumblr is currently performing scheduled maintenance but will be back shortly! Sorry for any inconvenience." }

Please do not try to string match against that response, as it may change any time between now and the actual maintenance.

As always, Our Ask box is always open for any questions or concerns you might have.

Rate-Limiting Bug (Random threads not found)

Hey, folks – I’ve had a couple people come to me recently with issues regarding having a few (somewhat random) posts appear as not found any time they open the tracker. I’ve looked into this and I believe it’s a result of the app running up against Tumblr’s API rate-limiting (guard in place to prevent any given user from flooding their API and DDoSing them, basically; this isn’t really a surprise or Tumblr-specific). 

I’m looking into whether the limits changed recently and making some plans to update the app to send requests to Tumblr in batches and hopefully avoid running into this issue; in the meantime, if you’re encountering this issue with your account, you may find it a good workaround to cut down the number of threads you’re tracking if you have some on hand that are no longer active.

I’ll post further updates on this as I look into it further.

Thanks,

Trackermun

Twitter is really not reacting well to me shutting marxbot down. Which is funny bc I never interacted with anyone there at all. The bot has 16,000 followers I just never cared enough about Twitter to actually sign in to the bots account and look at anything. It’s just Twitter has their own python library for accessing their api and tumblr doesn’t as far as I know so it was only a means to get the content to post somewhere and then I could link the blog to the Twitter account bc I’m a shitty lazy programmer but it turned out to be a much bigger deal there than it is here.

Golang and The Tumblr API

You’ve been asking for an official Golang wrapper for the Tumblr API. The wait is over! We are thrilled to unveil two new repositories on our GitHub page which can be the gateway to the Tumblr API in your Go project.

Why Two Repos

We’ve tried to structure the wrapper in a way that is as flexible as possible so we’ve put the meat of the library in one repo that contains the code for creating requests and parsing the responses, and interacts with an interface that implements methods for making basic REST requests.

The second repo is an implementation of that interface with external dependencies used to sign requests using OAuth. If you do not wish to include these dependencies, you may write your own implementation of the ClientInterface and have the wrapper library use that client instead.

Handling Dynamic Response Types

Go is a strictly typed language including the data structures you marshal JSON responses into. This means that the library could have surfaced response data as a map of string => interface{} generics which would require the engineer to further cast into an int, string, another map of string => interface{}, etc. The API Team decided to make it more convenient for you by providing typed response values from various endpoints.

If you have used the Tumblr API, you’ll know that our Post object is highly variant in what properties and types are returned based on the post type. This proved to be a challenge in codifying the response data. In Go, you’d hope to simply be able to define a dashboard response as an array of posts

type Dashboard struct {
  // ... other properties
  Posts []Post `json:"posts"`
}

However this would mean we’d need a general Post struct type with the union of all possible properties on a Post across all post types. Further complicating this approach, we found that some properties with the same name have different types across post types. The highest profile example: an Audio post’s player property is a string of HTML while a Video post’s player property is an array of embed strings. Of course we could type any property with such conflicts as interface{} but then we’re back to the same problem as before where the engineer then has to cast values to effectively use them.

Doing Work So You Don’t Have To

Instead, we decided any array of posts could in fact be represented as an array of PostInterfaces. When decoding a response, we scan through each post in the response and create a correspondingly typed instance in an array, and return the array of instances as an array of PostInterfaces. Then, when marshalling the JSON into the array, the data fills in to the proper places with the proper types. The end user can then interact with the array of PostInterface instances by accessing universal properties (those that exist on any post type) with ease. If they wish to use a type-specific property, they can cast an instance to a specific post type once, and use all the typed properties afterward.

This can be especially convenient when paired with Go’s HTML templating system:

snippet.go

// previously, we have some `var response http.ResponseWriter`
client := tumblrclient.NewClientWithToken(
    // ... auth data
)

if t,err := template.New("posts").ParseFiles("post.tmpl"); err == nil {
    if dash,err := client.GetDashboard(); err == nil {
        for _,p := range dash.Posts {
            t.ExecuteTemplate(response, p.GetSelf().Type, p.GetSelf())
        }
    }
}

post.tmpl

{{define "text"}}
<div>
    {{.Body | html}}
</div>
{{end}}
{{define "photo"}}
<div>
    Post: {{.Type}}
</div>
{{end}}
{{define "video"}}
<div>
    Post: {{.Type}}
</div>
{{end}}
{{define "audio"}}
<div>
    Post: {{.Type}}
</div>
{{end}}
{{define "quote"}}
<div>
    Post: {{.Type}}
</div>
{{end}}
{{define "chat"}}
<div>
    Post: {{.Type}}
</div>
{{end}}
{{define "answer"}}
<div>
    Post: {{.Type}}
</div>
{{end}}
{{define "link"}}
<div>
    Post: {{.Type}}
</div>
{{end}}

This is a rudimentary example, but the convenience and utility is fairly evident. You can define blocks to be rendered, named by the post’s type value. Those blocks can then assume the object in its named scope is a specific post struct and access the typed values directly.

Wrapping Up

This is a v1.0 release and our goal was to release a limited scope, but flexible utility for developers to use. We plan on implementing plenty of new features and improvements in the future, and to make sure that improvements to the API are brought into the wrapper. Hope you enjoy using it!

ChangeLog for the Week of 08/07/12

This week we have a few new features to announce for developers!

First up, We have added the ability for applications to access private blogs & posts for a user when sending a fully authenticated request to /posts and /user/info. This has been one of most requested features on the API Forum, so we’re excited to release it to you all. The full documentation is currently up and available here.

Here are a few other documentation tweaks that have gone up:

  • Liked - A Boolean field that tells you if the currently authenticated user has liked a post.
  • Queued Docs - Updates to pagination documentation.
  • Submissions Docs - Updates to pagination documentation.

We also want to let you know that we’ve opened up Asks and we’re more than happy to help field any problems or questions you may have!

XKit + Chrome Update (Part III of III)

What is complete:

The following extensions have been updated (again, with huge thanks to WyohKnott) to work with Tumblr API v2, so they now work correctly on Chrome: 

Notifications+, Read More Now, Post Limit Checker, Blog Tracker, Post Archiver, Profiler, XStats, User Menus+, Tag Replacer, TagViewer, View on Dash.

These updates depend on a change made to XKit Patches, a “hidden” extension, so please use XKit Control Panel > Other > Update All to update the extensions.

What is left to do:

XCloud needs some rewriting to make it compatible with the latest changes, since even though it now supports logging in and downloading your saved data, it still does not support creating a new account or uploading your settings. Audio Downloader also needs a rewrite, but it will be available as soon as possible.

I’m also working on Safari port, and since now XKit has two separate servers, I will be updating the Firefox port to use the server Chrome uses too, to unify the code.

A personal message, again:

I would like to once again point out that, on my personal blog, I’ve never made any racist, xenophobic/homophobic/transphobic comments. There was one post I’ve made, which was written shortly after seeing posts like “kill Tumblr staff” in relation to their April Fools prank, and for which, you can find my reply and apology here. (Also includes my response to allegations of racism, transphobia, etc.)

I know this might be futile attempt, especially to those who make stuff up like I’ve made fun of someone’s pronouns, made rape jokes or other behaviour that I would never do to paint me as an evil man hiding behind a “good guy” mask, but I guess it is worth a try since silence (even though this is my 4th post about this) is usually interpreted as accepting the allegations.

And I use “make stuff up”, since there is absolutely nothing on my personal blog that can be even misunderstood as transphobia/homophobia or jokes about rape. Those are completely groundless.

And as always, thank you for reading, and thank you for your support and patience.

So with Skylar 2.0’s development plans starting to be finalized, here’s some news about what to expect:

-For the people that’ve been following along Skylar’s development on my main blog @breastforce, you’ll know that the main thing I’ve been working on lately is her Learning and Responding abilities, which are everything that makes Skylar, well, Skylar.

-I’ve tried a number of things and nothing’s really worked, and I so I decided only modeling off of how Skylar currently does things, only heavily upgraded.

What this means:

-If you saw the Skykar 2.0 tests, she’s not going to be able to consistently answer things like that. I’m sorry but it couldn’t be done without sacrificing many of the things that are endearing about Skylar.

-Instead, I’m opting to see if she can learn all this stuff over time instead of me programming it into her.

-Afterwards, I may start working on a ‘Sister Robot’ that incorporates many of the ideas I’ve had for 2.0, that gives me a clean slate to work with rather than trying to make sure she’s able to say things like “Beep beep goes the Jeep”

It’s still going to be a massive upgrade with a noticable increase in coheriency, it’s just not going to be quite at the level that was showcased earlier. 

———

So to give people a clear idea of what to expect, here are the updates that Skylar is receiving:

-Code rebuilt from the ground up to reflect everything I’ve learned in the past year of programming.

-Her new code allows her to process things much faster and effeciently, making instant messaging and IRC a viable option.

(Note: Tumblr API still doesn’t work with messging, and she’s still going to have a built-in delay when answering asks so she doesn’t flood people’s dashboards)

-Her sentence parsing has been heavily upgraded based off of Google’s SyntaxNet, meaning that she’s much more able to understand what you are saying.

-The ability to store much more information about a concept and to label/categorize what that information refers to.

-The ability to store grammatical information about a word, where it’s a noun, verb, singular, plural, possessive.

-The ability to understand when two words are referring to the same thing (I.e. She won’t register the Singular and Plural forms of something as two different things)

-The ability to comprehend pronouns and what they are referring to, even across sentences. (If you say “Dogs are nice. They are soft.”, she’ll be able to tell that ‘they’ is referring to 'dogs’)

-The ability to know who the person sending an ask is and learn/recall things about them. (I.e. When you use the word “I”, she’ll know that you are specifically referring to yourself, and she’ll associate that information with your tumblr account)

-The ability to look new words up in the dictionary as she comes across them, including being able to tell if a word is a synonym or another form of something she already knows.

-The ability to make sure that her own sentences are grammatically correct (as far as she knows).

-The ability to use punctuation and make responses that are more than a sentence long.

Most importantly of all, Skylar 2.0 is very well on track for an August release. July is going to be a busy month for me as I work on bringing Skylar 2.0 to completion. I appriciate the support and patience that everybody has given me as I’ve worked on this project so far. I hope you’ll enjoy her when she’s released.