Get tweets for a user in spring mvc - spring-mvc

How to get tweets for a user in spring mvc just like how twitter widget works
I dont want to create application as mentioning in http://spring.io/guides/gs/accessing-twitter/. instead need to read without connecting
Want to read the top tweets for the specified user and need to display in JSP in custom format. Is there any way in spring mvc?

If you are using version 1.0.5 of spring-social-twitter - TwitterTemplate will allow a few simple operations that do not require authorization, such as searching. You need to create an instance of TwitterTemplate without passing in any oauth parameters.
http://docs.spring.io/spring-social-twitter/docs/1.0.5.RELEASE/reference/html/apis.html

Related

How do I auto sign in to Laravel via an API coming from .net?

We have a portal built in asp.net and we need one of the sections to be an embedded frame containing a webapp built in Laravel, however the Laravel webapp has a login and we dont want users having to login twice. So how do I set this up? I understand I need to use this method :
https://laravel.com/docs/5.4/authentication#authenticating-users
The request would be coming from .net and I would parse say the JSON response, but how do I setup laravel to consume that API call? I have never done anything like this before and I dont know where to start. Can someone explain or give me a series of steps? Thank you!
if you have the user id as $id, you can use:
Auth::loginUsingId($id);

How to display a web service (SOAP) JSON result in a Drupal View

I'm a Drupal beginner, and I would like to display a web service (SOAP) result (in JSON) in a page.
I would like to display the result in a table (so I think Drupal View would be nice to display it...), but I don't know how to bring the Web Service result to display it into a View.
I am using the module "wsclient" (http://drupal.org/project/wsclient) together with "Rules" to execute a web service method, and I am able to get its result into a message, but that's all I was able to do until now.
I'm new to Drupal. Can someone help me please, to perform this action in the best way?
I am using Drupal 7.
Thank you!
There's a feature request in the wsclient issue queue for views integration: http://drupal.org/node/1215570
EDIT: as pointed out in the comments below, the following does not apply to the original question:
Have you considered using the Services module instead? There is already views integration for it.

Dynamic forms using ASP.NET

I want to design and develop a web base software that enable user to report a problem or discussion using ASP.NET and SQL server.
This application might has many forms. For example Form A for reporting bug for software 1 and etc.
I don't want to create a table for keeping data per form.
Solution that comes to my mind is making UserControl per form. and when user chooses a form application loading target usercontrol.
Now I have challenge for save and restore data that user entered into target usercontrol.
What is your suggestion ?
What do you suggest instead of using UserControl ?
I have also review using XML to keeping forms structures but I think its hard to create UI from XML .
I can not see the difficulty in saving and restoring your data.
If you use user control, then I assume you want to reuse it in other forms as well, or it doesnt make any sense.
Or what you want is to load asp.net controls dynamically?
Then step by step:
Firstly create a proper form page you need, then convert it into several user controls (according the business logic).
Reuse user controls you just converted in other forms based on XML
config files, or URL, or query string or session. In XML you can specify the method name you going to call for saving or retrieving data. (That's the structure of one of projects I worked on)
Hoep it helps.
How to: Convert Web Forms Pages into ASP.NET User Controls

caching clearing

I have to implement cache clearing (like when we refresh form is not submitted again) in my application, where using spring MVC.
Is there any inbuilt filter available or any other way to customize a filter for the same ?
In order to prevent the user re-posting you might want to redirect to your view rather than simply returning it.
From the spring documentation:
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-redirecting

How to parse PropertyName PropertyValue data?

Two web applications I'm working with are using the ASP.NET membership and each have areas for user information which use this Property name/value storage method in the database.
Here is an example:
PropertyNameValues
publicEmail:S:0:19:yahooIM:S:19:0:timezone:S:19:2:commonName:S:21:4:birthdate:S:25:81:signatureFormatted:S:106:0:gender:S:106:1:fontsize:S:107:1:signature:S:108:0:dateFormat:S:108:15:enableEmoticons:S:123:4:webLog:S:127:0:enablePostPreviewPopup:S:127:5:location:S:132:12:bio:S:144:0:webAddress:S:144:0:interests:S:144:0:icqIM:S:144:0:aolIM:S:144:0:language:S:144:5:occupation:S:149:0:msnIM:S:149:0:
PropertyValues
someemailhere#here.com-6Asia<?xml version="1.0" encoding="utf-16"?>
<dateTime>0001-01-01T00:00:00</dateTime>20ddd, MMM d yyyyTrueFalseTest Testing-US
I can see the jist of how it works, name values show at what length in the property value string to begin grabbing and when to end - but is there an existing function to split these apart into an array or something?
Thanks!
How this works depends on if you are using a "web site" or a "web application" project type. If you are using a regular asp.net web site project, you will have a dynamically generated Profile object you can use to fetch user properties from.
If your application is MVC or a Web Application Project though, you will have to make your own profile object. I recommend you grab the web profile builder. This tool creates the ProfileCommon object that is needed to get at the profile data.
In general, I personally have found through repeated exposure that the Profile provider system supplied in asp.net is quite dreadful for storing actual user information (the kind of stuff you are using it for). The profile provider mechanism is great for stuff like user preferences (stuff usually called personalization) such as "always show details" or "I prefer the green background". The reason is that the profile system only makes the profile data easily accessable within the request of the one user. If you have admin tools that need to read from multiple user's profiles, you will find that performance will quickly degenerate, and getting at the profile data is actually quite difficult.
For these reasons, I recommend that you consider not using the profile system for the kind of data you are storing there. You will be a lot better off rolling your own tables and objects to store and fetch this particular kind of info. But if you never need to access the data for more than one user at a time, the built-in profile stuff is alright.
It looks like you're referring to the ASP.NET Profile system.
Within the code-behind of an aspx page, just use Profile.publicEmail, Profile.yahooIM, etc. There's an automatically generated class that parses that out for you. See the linked article for more details.

Resources