Dream.In.Code Summer of API Contest - WIN by working with the DIC API

  • (8 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »

110 Replies - 40245 Views - Last Post: 01 September 2010 - 02:02 PM

#16 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 11:47 AM

I'm not eligible but I'm going to try and make some times to work on something for this. Very interesting, excellent competition idea
Was This Post Helpful? 0
  • +
  • -

#17 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 550
  • View blog
  • Posts: 5,624
  • Joined: 20-March 08

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 02:35 PM

I may have to try my hand at this, even though I can't win.

Whatever language I determine suitable...I may even use Scheme/Racket. :)
Was This Post Helpful? 0
  • +
  • -

#18 KingCuddles  Icon User is offline

  • D.I.C Regular

Reputation: 176
  • View blog
  • Posts: 496
  • Joined: 20-December 08

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 03:19 PM

Bonus points for anyone who can do it in BrainFuck.. is it even possible in BrainFuck?
Was This Post Helpful? 0
  • +
  • -

#19 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 550
  • View blog
  • Posts: 5,624
  • Joined: 20-March 08

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 03:21 PM

Not to my knowledge.

However, I think anyone that figures out how to do it in BrainFuck deserves an internet or two.
Was This Post Helpful? 4
  • +
  • -

#20 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5074
  • View blog
  • Posts: 13,697
  • Joined: 18-April 07

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 04:23 PM

Is there even an official guide to the API? I hardly call like 3 calls a real API. Unless there are more. Would be nice to have some documentation outlining what is in and parameters available to the API

Just a thought. :)
Was This Post Helpful? 2
  • +
  • -

#21 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1949
  • View blog
  • Posts: 20,376
  • Joined: 17-March 01

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 04:36 PM

This is more of an XML version of the site that you can parse easily, right now it's just the forums. The next version of the forums has a better API supposedly that will actually allow for some read/write.
Was This Post Helpful? 0
  • +
  • -

#22 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 614
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 05:28 PM

I'll try to think of something to do in Clojure. I *really* think this "competition" is putting the cart before the horse. It would have made a lot more sense to wait until the API was actually useful.
Was This Post Helpful? 1
  • +
  • -

#23 dorknexus  Icon User is offline

  • or something bad...real bad.
  • member icon

Reputation: 1272
  • View blog
  • Posts: 4,625
  • Joined: 02-May 04

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 01 July 2010 - 11:20 PM

Ok done although not as effective as I had hoped. This simple program opens up a topic and smashes all the posts together into a string. Then, using markov chains, it assembles random sentences based on the content of the topic. However, it is far more effective with large amounts of text, so this isn't as funny as it was supposed to be:

require 'net/http'
require 'rexml/document'

url = "http://www.dreamincode.net/forums/xml.php?showtopic=179769"
xml_data = Net::HTTP.get_response(URI.parse(url)).body
doc = REXML::document.new(xml_data)

text = ''

doc.elements.each('ipb/forum/topic/posts/post') do |elem|
  post_text = elem.elements["text"].text
  text << post_text unless post_text == nil
end

tokens = text.split(' ')

end_sentence = []
table = {}
prev1 = ''
prev2 = ''

tokens.each do |word|
  if prev1 != '' and prev2 != ''
    key = [prev2, prev1]
    
    if table.has_key? key
      table[key] << word
    else
      table[key] = [word]
      if prev1[-1] == '.' or prev1[-1] == '!' or prev1[-1] == '?'
        end_sentence << key
      end
    end
  end

  prev2 = prev1
  prev1 = word
end

puts end_sentence
key = []
count = 5

while count > 0
  if table.has_key? key
    word = table[key].sample
    print word + " "
    key = [key[1], word]

    if end_sentence.include? key
      count = count - 1
    end
  else
   key = end_sentence.sample
  end
end

##



Should be compatible with Ruby 1.9

This post has been edited by Dark_Nexus: 02 July 2010 - 09:15 AM

Was This Post Helpful? 0
  • +
  • -

#24 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1949
  • View blog
  • Posts: 20,376
  • Joined: 17-March 01

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 02 July 2010 - 07:08 AM

I think if you focus on the profile XML data that shows friends, you could make an interesting visual representation of 6-degrees-of-seperation or something similar.

But you could also create things like topic alerts, "unanswered" topics across certain forums.

We've had a lot of people asking for a contest, so figured this could be something fun. We'll certainly have another contest when the next (actual) API is available. But have some other initiatives right now that bring more functionality than a full fledged API would bring.

Have fun with this one in the mean time, and we'll try to do some other contests more often.
Was This Post Helpful? 0
  • +
  • -

#25 H3R3T1C  Icon User is offline

  • Android Expert
  • member icon

Reputation: 278
  • View blog
  • Posts: 757
  • Joined: 30-March 07

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 02 July 2010 - 07:33 AM

Im totally going to make an android app with this api :D!
Was This Post Helpful? 0
  • +
  • -

#26 baavgai  Icon User is online

  • Dreaming Coder
  • member icon


Reputation: 6979
  • View blog
  • Posts: 14,602
  • Joined: 16-October 07

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 02 July 2010 - 07:46 AM

Looks interesting. Some questions:

Other than examples, is there, um, and actual API doc?

Is it all just read or is there some post potential?

Reasonably, if you like a submission, you'd like to implement it? Your preferred tools are PHP, MySql, and Javascript, I'm guessing?
Was This Post Helpful? 0
  • +
  • -

#27 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1949
  • View blog
  • Posts: 20,376
  • Joined: 17-March 01

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 02 July 2010 - 07:52 AM

Yes, PHP, MySQL, Javascript.

There isn't a formal document. It's basically the exact same information you see when looking at a thread, just in XML format. So as you click around the forums, it's the exact same data.

I don't believe there is a "post" mechanism in the XML "skin" (which is really what this is).

We did not actually create this, so none of our time went in to making it. It was packaged with the forum software, and I simply made it available to all of you to play with.
Was This Post Helpful? 0
  • +
  • -

#28 baavgai  Icon User is online

  • Dreaming Coder
  • member icon


Reputation: 6979
  • View blog
  • Posts: 14,602
  • Joined: 16-October 07

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 02 July 2010 - 07:57 AM

View Postskyhawk133, on 02 July 2010 - 08:52 AM, said:

It was packaged with the forum software, and I simply made it available to all of you to play with.


Cool, thanks.

Wait, you didn't write it? That's like finding out the mechanic doesn't fix his own car. I'm totally disillusioned. :P
Was This Post Helpful? 0
  • +
  • -

#29 dorknexus  Icon User is offline

  • or something bad...real bad.
  • member icon

Reputation: 1272
  • View blog
  • Posts: 4,625
  • Joined: 02-May 04

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 02 July 2010 - 07:44 PM

Quote

I'll try to think of something to do in Clojure. I *really* think this "competition" is putting the cart before the horse. It would have made a lot more sense to wait until the API was actually useful.


I agree. Not really much you can do with four XML views. Good to know there is an API in the works though.

This post has been edited by Dark_Nexus: 02 July 2010 - 07:45 PM

Was This Post Helpful? 0
  • +
  • -

#30 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6245
  • View blog
  • Posts: 24,013
  • Joined: 23-August 08

Re: Dream.In.Code Summer of API Contest - WIN by working with the DIC API

Posted 03 July 2010 - 09:39 AM

Oops, bug in the XML generator:

http://www.dreaminco...hp?showforum=15
Was This Post Helpful? 0
  • +
  • -

  • (8 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »